A clever hands-on interactive mini-course by Nathan Whitehead that guides you through bite-sized chunks from variables, to functions, to return values, to functions as first-class objects and right into closures and finally continuations. The hands-on exercises are JS Linted and unit-tested which gives you ample space to try out your new-found knowledge.
Douglas Crockford explains the new strict mode introduced in the 5th edition of ECMAScript. It is an opt-in mode that repairs or removes some of the language's most problematic features such as: function scoping, implied global variables and global leakage, read-only variable failures, octal defaults and function arguments.
Tim describes another two different approaches to using the Module Pattern (a way of creating Singletons). The first example takes advantage of the natural indentation to clearly see which methods are private and which are public. The second is a curried function, a function that returns another function.
Christian Heilmann offers another incremental improvement to the Module Pattern, and calls it the Revealing Module Pattern. This defines an anonymous object that contains a list of methods and properties that are publicly available. Christian notes that this method also allows you to set up a public property that's privately generated by a method. Christian's improvement makes it quickly clear which properties and methods are public.
As web pages become more and more like applications, code performance becomes more and more important. This article looks at a number of performance issues to avoid, in EcmaScript, DOM and AJAX requests. Covers eval, the with keyword, try/catch in performance-critical code, global variables, implicit object conversion, string concatenation, primitive operations over function calls, repainting and reflowing documents, modifying elements, using XPath.
An explanation of scope in terms of an execution context and scope chain. Also describes how we can alter the this reference using apply and call.
Dean Edwards gets to grips with the
window.onload problem - where it only gets fired once the document and its associated styles and images are loading. The ideal solution is one that that detects when the document is available as a DOM.