Literals are constant values used in assignments or as arguments to functions or expressions. A literal is considered to be a primary expression when it is being evaluated.
There are several kinds of literals. They are all based on the primitive types. The ECMA standard defines four basic data types, which should be sufficient for most purposes; however, a hosted interpreter may provide other more esoteric primitive values. Here are the four core standard types:
Null
Boolean
Numeric
String
These are objects that can also be manufactured from literals:
Array
Date
Regular expression
Object
Void
String literals also include escaped character literals which may also be used in regular expressions.
Host environments additionally define others for special purposes depending on the implementation.
ECMA 262 edition 2 - section - 7.7
ECMA 262 edition 2 - section - 11.1.3
ECMA 262 edition 3 - section - 7.8
ECMA 262 edition 3 - section - 11.1.3
O'Reilly JavaScript Definitive Guide - page - 30
Prev | Home | Next |
LISTING object | Up | Little endian |
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. |