JavaScript Random Hints
Update some point has been made more clear, thanks to Dmitry Soshnikov for suggestions. Forget the global undefined Too many developers relies into undefined variable in ES3, and all they should do is to set undefined = true on global scope and see if the application or all unit tests break or not. I am going to demonstrate how simple is, at least in ES3, to redefine by mistake the global undefined. // inside whatever closure/scope function setItem(key, value) { this[key] = value; } // later in the scope, setItem may be reused // through call or apply for whatever object setItem.call(myObject, myKey, "whatever value"); // if for some reason the first argument used as context // is undefined, the "this" will point to the global context // if for some reason the second argument used as key // is undefined, the accessor will cast it as undefined string // the result of latter call with these two // common or simple conditions // is the quivalent of: window.undefin...