
ECMAScript 5 Objects and Properties - johns
http://ejohn.org/blog/ecmascript-5-objects-and-properties/
======
Hexstream
Can someone explain the benefits of the new lockdown features besides new
opportunities for performance optimization?

~~~
axod
I think 'lockdown' type things can be really helpful when debugging code.
Being able to lock something down, and be 100% sure that it can never be
changed, by some weird eval(), by any 3rd party libs you're using, other
developers code etc is very helpful.

You could also use it to find where a property is being accessed from - just
set it to writable:false - then see where an exception is thrown from.

Also enforcing access - maybe you have a setTitle() function you want to be
used instead of directly accessing the .title property. Now you can enforce
that.

Just as in Java, the keywords private and protected are a good mechanism for
controlling access.

These updates look really cool. Well thought out.

~~~
mshafrir
Lockdown would be like the final keyword in Java.

------
TweedHeads
Javascript is the most important language of the 21st century.

Master javascript and the web will be at your fingertips.

