Declaration (Definition)

Declares the attributes of an identifier.

A declaration gives the type and scope of an identifier.

It specifies whether the identifier refers to a function or a variable and indicates what its name is. The scope is indicated by the placement. Variables are scoped globally if they are created outside of a function script source block.

When storage is being allocated, a declaration is sometimes called a definition. This means you might declare a function and define a variable. If you indicate the size of an array then that would be a definition.

See also:Definition, Initialization, JavaScript language, Scope chain, Variable Declaration