Sample Video Frame

Created by Zed A. Shaw Updated 2024-06-20 22:54:43

22: More Complex OOP

The code from Exercise 21 works, but you'd be missing out on quite a few features of JavaScript OOP, and you don't receive any computation benefits. The JavaScript virtual machine will take advantage of your classes and potentially give you additional checks, potential optimizations, and other features. If you use your hand rolled "baby OOP" then you won't get any of these benefits.

The Code

For this exercise you have two files to look at. First there's the code from the previous exercise but cleaned up so that you can compare it to the same code for this exercise:

View Source file ex21.js Only

Previous Lesson Next Lesson

Register for Learn JavaScript the Hard Way

Register today for the course and get the all currently available videos and lessons, plus all future modules for no extra charge.