I think you may want to elaborate on the following in your write-up:
"If you use reserved words on objects and attempt to access them through dot notation, your code will not work in older versions of IE."
var example = {
"private": function () {}
};
// Can and will, break in older browsers.
example.private;
// Will work in older browsers.
// Acceptable, in my opinion only for the three situations I mentioned earlier.
example['private'];
So, I don't believe this is accurate. As far as the JavaScript interpreter is concerned, there are no limitations on object property names as long as they are initialized correctly. In your example, initializing without quotes would be the part to cause potential browsers issues. For example:
var obj1 = { function: function() {} }; //Errors in IE7
var obj2 = { "function": function() {} }; //Works in IE7
Even though "function" is a reserved word, when it's inside of a String it's not interpreted as an Identifier and works just fine. I recommend revising this part of your text to make sure it's accurate. Also it may be helpful if you provide exact version numbers of IE (or other browsers) where you say certain things won't work.
I think you may want to elaborate on the following in your write-up:
"If you use reserved words on objects and attempt to access them through dot notation, your code will not work in older versions of IE."
So, I don't believe this is accurate. As far as the JavaScript interpreter is concerned, there are no limitations on object property names as long as they are initialized correctly. In your example, initializing without quotes would be the part to cause potential browsers issues. For example:
Even though "function" is a reserved word, when it's inside of a String it's not interpreted as an Identifier and works just fine. I recommend revising this part of your text to make sure it's accurate. Also it may be helpful if you provide exact version numbers of IE (or other browsers) where you say certain things won't work.
For reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Reserved_Words#Reserved_word_usage
(In any case, great writing!)