SHSubjectHub

Inheritance and Subclasses (JavaScript)

OOPA-levelLesson packSubscription

About this resource

Understand how one class can inherit from another in JavaScript using extends, how to use super() in the constructor, and how to check types at runtime.

11 slides.

Lesson outline

  1. Is-A or Has-A?
  2. The Is-A Relationship
  3. Writing a Subclass in JavaScript
  4. Dog Inherits From Animal: Live Demo
  5. UML: Inheritance Arrow
  6. `instanceof` — Type Checking in JavaScript
  7. Python vs JavaScript: Inheritance Syntax
  8. Coding Practice: Animal Hierarchy
  9. Lesson Summary
Unit bundleUnit 3A · Inheritance and Subclasses
Part of: Unit 3A · Inheritance and Subclasses: the whole unitEvery resource in the unit in one zip.

More from Unit 3A · Inheritance and Subclasses