Leaderboard Archive
Javascript Apr 27, 2026

What gets logged?

const obj = { a: 1 }
Object.freeze(obj)
obj.a = 99
console.log(obj.a)
A 99
B 1
C undefined
D TypeError
Explanation
Object.freeze() locks an object so its properties cannot be changed. Trying to change obj.a silently does nothing in normal mode. In strict mode it would throw an error. The value stays 1. Freeze is shallow — it only protects the top level, not nested objects.
📝
Reviewed by CodeShot Editorial
Every challenge is code-reviewed by senior developers to ensure accuracy and real-world relevance. Learn more.

Ready for your shot?

Join thousands of developers solving one logic puzzle every morning.

Solve Today's Challenge →