Prev Next

Web / ES6 Interview questions

Difference between const vs Object.freeze().

const applies to bindings ("variables"). It creates an immutable binding, i.e., you cannot assign a new value to the binding.

Object.freeze works on values, and more specifically, object values. It makes an object immutable, i.e., you cannot change its properties.

More Related questions...

Show more question and Answers...


Comments & Discussions