Literals

image with no caption
image with no caption

Object literals are a convenient notation for specifying new objects. The names of the properties can be specified as names or as strings. The names are treated as literal names, not as variable names, so the names of the properties of the object must be known at compile time. The values of the properties are expressions. There will be more about object literals in the next chapter.

image with no caption

Array literals are a convenient notation for specifying new arrays. There will be more about array literals in Chapter 6.

image with no caption

There will be more about regular expressions in Chapter 7.

Get JavaScript: The Good Parts now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.