Chapter 5Objects
Everything in JavaScript is either one of the five primitive values we met in Chapter 2 (strings, numbers, Booleans, undefined, and null) or an object. We’ve actually met some objects already; arrays in Chapter 3 and functions in Chapter 4 are both objects, although these are built-in objects that are part of the language. In this chapter we’re going to look at user-defined objects as well as some other built-in objects.
In this chapter, we’ll be covering the following topics:
-
object literals
-
adding properties to objects
-
object methods
-
JSON
-
the
Mathobject -
the
Dateobject -
the
RegExpobject -
our project―create quiz and question objects and ask random questions
Object Literals
An object in JavaScript is a self-contained ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access