O'Reilly logo

JavaScript Object Programming by Martin Rinehart

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 4

image

Inheritance Practice

In this chapter we get back to coding. We’ll look at the practical steps you need to take to make OOP-style inheritance work, using JavaScript as Eich designed it.

When family E extends B, an instance of E has some of its own data and method properties, and it acquires the data and method properties of family B. Instance data properties are commonly assigned by the constructor and instance methods are commonly made available in the prototype. In this chapter you’ll see how JavaScript—plain JavaScript, library functions not required—can successfully use its hybrid class/prototypal object model to create class-based ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required