Built-in Objects

Earlier in this chapter we came across the Object() constructor function. It is returned when you create objects with the object literal notation and access their constructor property. Object() is one of the built-in constructors; there are others and in the rest of this chapter you'll see all of them.

The built-in objects can be divided into three groups:

  • Data wrapper objects—Object, Array, Function, Boolean, Number, and String. These objects correspond to the different data types in JavaScript. Basically, there is a data wrapper object for each different value returned by typeof (discussed in Chapter 2) with the exception of "undefined" and "null".
  • Utility objects—These are Math, Date, RegExp and can come in very handy.
  • Error ...

Get Object-Oriented JavaScript 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.