Saturday, January 05, 2013

Adequately Good - JavaScript Module Pattern: In-Depth - by Ben Cherry

Adequately Good - JavaScript Module Pattern: In-Depth - by Ben Cherry: "Notice that we've declared a global module named MODULE, with two public properties: a method named MODULE.moduleMethod and a variable named MODULE.moduleProperty. In addition, it maintains private internal state using the closure of the anonymous function. Also, we can easily import needed globals, using the pattern we learned above."

'via Blog this'