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.
| Prev | Home | Next |
| const | Up | Constant expression |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. | ||