Secrets of the JavaScript Ninja: A sneak peak
John Resig(Creator of jQuery) is working on the Secrets of the JavaScript Ninja book, which I am sure will be a great book for those who love JavaScript. Here are some sneak peak chapters given out by Manning to Ajaxian:- Introduction
- How Closures Work
Closures are one of the defining features of JavaScript, differentiating it from most other scripting languages. Simply: A closure is a way to access and manipulate external variables from within a function. Another way of imagining it is the fact that a function is able to access all the variables, and functions, declared in the same scope as itself... - Using (function(){})()
This article introduces the construct (function(){})() and describes its use in relationship to closures... - Instantiation and Prototypes
All functions have a prototype property which, by default, contains an empty object. This property doesn't serve a purpose until the function is instantiated. In order to understand what it does. it's important to remember the simple truth about JavaScript: Functions serve a dual purpose. They can behave both as a regular function and as a "class" (where they can be instantiated)... - Class-like Code
A common desire, for most developers, is a simplification--or abstraction--of JavaScript's inheritance system into one that they are more familiar with. This tends to head towards the realm of, what a typical developer would consider to be, Classes. While JavaScript doesn't support classical inheritance natively (at least not until JavaScript 2), generally there are a few features that developers crave...
Related posts brought to you by Yet Another Related Posts Plugin.



No Comments Comments Feed
Add a Comment