Friday, February 27, 2009

Ever wondered how to script "Closures" in JS ?

Anonymous / Inner Classes in Java are quite famous, with event handlers. Closures in JS are similar, not quite the same.
Closures are expressions, usually functions, which can work with variables set within a certain context. Or, to try and make it easier, inner functions referring to local variables of its outer function create closures.

Read it here as explained quite nicely by Morris Johns.

Classy JS => Prototypes

An excellent read about how to make an otherwise class-less java script emulate classes.
Read it here.

-Thanks Morris