Constant (Definition)

A literal description of a fixed value.

A constant is a lexical element that represents a set numerical or string value.

Numeric values can be integer or floating-point. String values may define only a single character but are nevertheless still considered to be a string.

The Number and Math objects provide constant values as properties of the object class. These are static constants. Other static constants are provided by the implementation. For example the Event object supplies a set of masks in some implementations. These masks can be used to determine keyboard states. The DOM standard defines others as part of the event model.

See also:Character constant, Constant expression, Escape sequence (\), Floating constant, Integer constant, Lexical element, Literal, Math object, Number object, Primary expression, Variable

Cross-references:

Wrox Instant JavaScript - page - 13