JavaScript Wiki
A page in the
 
Introduction
 
Basics
Statements · Control Flow Statements · Comments · Objects · Functions · Style
Features
Scoping · Inheritance · DOM


It has been suggested that this page or section be merged into Wikibooks:JavaScript. (Discuss)

Functions may be defined ("nested") inside other functions, thereby freeing up some global identifiers and keeping your data safe from that of other scripts.

If a function is defined in the global namespace, i.e. outside of all other functions, it is a method of the global object, window, and may be called as window.name .