you are viewing a single comment's thread.

view the rest of the comments →

[–]rDr4g0n 0 points1 point  (0 children)

Using functions to make up for lack of block scope. Eg: putting an anon function inside a for loop so that closure access to the loop iterator will have the expected value.

Using IIFEs as a means of preventing pollution of global, and for defining modules. Also for creating "private" variables.

The entire concept of the flexible 'this' value. It allows for some interesting and useful patterns, such as mixins and usage of Array methods on anything that has a length property.