Skip to main content

The function in your second example is no longer anonymous... it has a name, initSomething.

The first syntax is commonly used to set up a closure... trapping var x, y, z and what not within it so that they doesn'tdon't conflict with any other variables namedwith the same thingname outside of the closure.

The function in your second example is no longer anonymous... it has a name, initSomething.

The first syntax is commonly used to set up a closure... trapping var x, y, z and what not within it so that they doesn't conflict with other variables named the same thing outside of the closure.

The function in your second example is no longer anonymous... it has a name, initSomething.

The first syntax is commonly used to set up a closure... trapping var x, y, z and what not within it so that they don't conflict with any other variables with the same name outside of the closure.

Source Link
Brad
  • 163.5k
  • 57
  • 380
  • 558

The function in your second example is no longer anonymous... it has a name, initSomething.

The first syntax is commonly used to set up a closure... trapping var x, y, z and what not within it so that they doesn't conflict with other variables named the same thing outside of the closure.