Jump to content

Make a propert of Window object not writable/deletable


graduate

Recommended Posts

Object.defineProperty(window, 'num', { value:'655'});var num = 100;alert(window.num);

In Firefox the program throws exception "var num is read-only" and the variable isnt changed, but in IE and Chrome it outputs "100", the variable was changed without any errors.How does it work?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...