Thread:Manual talk:Coding conventions/JavaScript/Closures

I've changed the recommended closure format based on what I've recently seen used in core and as well as what I'm finding myself use.

Just shortly explaining in case anyone is interested.
 * Closure: To prevent leakage from and to other scopes
 * Arguments: Primarily for performance reasons so that  and   are available in the closest scope (or at least a scope closer than the global scope) instead of accessing the data from the global scope every time. It's also for shortness so that   is abbreviated to  . And to enforce that undefined is really undefined.
 * Callee: Using the global literals instead of properties of the  object. Reason being that if it would be undefined, it's better to catch the error at the ReferenceError in the callee then somewhere down the line where a property or function call is performed on "undefined". It also saves an additional property lookup after doing the scope chain lookup for "window".

References: