Appendix A. Review

The following points summarize what you should have learned during the reading of this book (and investigation of code examples). Read each summary, and if you don’t understand what is being said, return to the topic in the book.

  • An object is made up of named properties that store values.

  • Most everything in JavaScript can act like an object. Complex values are, well, objects and primitive values can be treated like objects. This is why you may hear people say that everything in JavaScript is an object.

  • Objects are created by invoking a constructor function with the new keyword, or by using a shorthand literal expression.

  • Constructor functions are objects (Function() objects), thus, in JavaScript, objects create objects.

  • JavaScript offers 9 native constructor functions: Object(), Array(), String(), Number(), Boolean(), Function(), Date(), RegExp(), and Error(). The String(), Number(), and Boolean() constructors are dual-purposed in providing a) primitive values and b) object wrappers when needed, so that primitive values can act like objects when so treated.

  • The values null, undefined, "string", 10, true, and false are all primitive values, without an object nature unless treated like an object.

  • When the Object(), Array(), String(), Number(), Boolean(), Function(), Date(), RegExp(), and Error() constructor functions are invoked using the new keyword, an object is created that is known as a “complex object” or “reference object.”

  • "string", 10, true, and false ...

Get JavaScript Enlightenment 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.