If you've used a more traditional object-oriented language, such as C++ or Java, JavaScript probably doesn't seem object-oriented at all. It has no concept of classes, and you don't even need to define any objects in order to write code. But don't be fooled—JavaScript is an incredibly powerful and expressive object-oriented language that puts many design decisions right into your hands.

In The Principles of Object-Oriented JavaScript, Nicholas C. Zakas thoroughly explores JavaScript's object-oriented nature, revealing the language's unique implementation of inheritance and other key characteristics. You'll learn:

  • The difference between primitive and reference values
  • What makes JavaScript functions so unique
  • The various ways to create objects
  • How to define your own constructors
  • How to work with and understand prototypes
  • Inheritance patterns for types and objects

The Principles of Object-Oriented JavaScript will leave even experienced developers with a deeper understanding of JavaScript. Unlock the secrets behind how objects work in JavaScript so you can write clearer, more flexible, and more efficient code.

Nicholas C. Zakas

Nicholas C. Zakas is a principal architect at Box, author, and speaker. He worked at Yahoo! for almost five years, where he was front-end tech lead for the Yahoo! homepage and a contributor to the YUI library. He is the author of Maintainable JavaScript (O’Reilly, 2012), Professional JavaScript for Web Developers (Wrox, 2012), High Performance JavaScript(O’Reilly, 2010), and Professional Ajax (Wrox, 2007). Nicholas is a strong advocate for development best practices including progressive enhancement, accessibility, performance, scalability, and maintainability. He blogs regularly at http://www.nczonline.net/ and can be found on Twitter via @slicknet.

  1. Chapter 1 Primitive and Reference Types

    1. What Are Types?

    2. Primitive Types

    3. Reference Types

    4. Instantiating Built-in Types

    5. Property Access

    6. Identifying Reference Types

    7. Identifying Arrays

    8. Primitive Wrapper Types

    9. Summary

  2. Chapter 2 Functions

    1. Declarations vs. Expressions

    2. Functions as Values

    3. Parameters

    4. Overloading

    5. Object Methods

    6. Summary

  3. Chapter 3 Understanding Objects

    1. Defining Properties

    2. Detecting Properties

    3. Removing Properties

    4. Enumeration

    5. Types of Properties

    6. Property Attributes

    7. Preventing Object Modification

    8. Summary

  4. Chapter 4 Constructors and Prototypes

    1. Constructors

    2. Prototypes

    3. Summary

  5. Chapter 5 Inheritance

    1. Prototype Chaining and Object.prototype

    2. Object Inheritance

    3. Constructor Inheritance

    4. Constructor Stealing

    5. Accessing Supertype Methods

    6. Summary

  6. Chapter 6 Object Patterns

    1. Private and Privileged Members

    2. Mixins

    3. Scope-Safe Constructors

    4. Summary