Loading video player…

Welcome to the Tool Library

You’ll learn where a JavaScript object finds what it inherits, what class syntax guarantees, and how classes cooperate.

Your project is Northbank Tool Library’s kit model, a Python module you’ll port to JavaScript. Northbank loans kits of tools, each with a label for its checkout desk. Here’s a first taste. In Python, Kit’s label property trims every label, and the drilling kit assigns a padded label in __init__():

Language: Python
class Kit:
    @property
    def label(self):
        return self._label

    @label.setter
    def label(self, value):
        self._label = value.strip()

class DrillingKit(Kit):
    def __init__(self):
        super().__init__()
        self.label = "  drilling  "

kit = DrillingKit()
print(f"[{kit.label}]")

It prints the label trimmed:

Language: Program Output
[drilling]

The JavaScript port keeps the getter and setter and moves the label into a class field, where JavaScript classes keep each instance’s starting value:

Language: JavaScript
class Kit {
  get label() {
    return this._label;
  }

  set label(value) {
    this._label = value.trim();
  }
}

class DrillingKit extends Kit {
  label = "  drilling  ";
}

const kit = new DrillingKit();
console.log(`[${kit.label}]`);

It prints the label, spaces and all:

Language: Program Output
[  drilling  ]

Keeping that setter in the loop is one of the jobs ahead.

Northbank’s Python module describes each kit, like KIT-17, by code and trimmed label. It walks a kit’s tools, as often as you ask, and wraps each description in a tag and an audit mark. The checkout app runs JavaScript, so the model moves across.

By the end of this course, you’ll be able to:

  • Trace how a JavaScript object finds a property, one link at a time, out to Object.prototype
  • Keep what class syntax guarantees when you port a class: where super looks, and when fields and setters run
  • Implement a language protocol, such as iteration, on your own class
  • Choose between an explicit chain of class layers and a part an object holds
  • Port Northbank’s loan kit model to JavaScript

In Python, you only need to know classes, super() and the method resolution order (MRO), properties and other descriptors, and dunder methods such as __iter__(). In JavaScript, you only need to know classes with constructor, fields, get and set, extends and super, Object.create() and Object.getPrototypeOf(), and symbol keys.

You’ll need a current version of Node installed, and no packages. The examples use Node 26 and Python 3.15.

The course mixes short videos with text lessons and exercises. Every video has a summary below it. A project ports the kit model, and a quiz and a summary close the course.

Next up: Following Property Lookup, where you follow the drilling kit’s links one at a time.

Download

Sample Code (.zip)

11.2 KB
Download

Course Slides (.pdf)

996.7 KB

00:00 Welcome to JavaScript Prototypes and the Object Model! You’ll learn where objects find inherited properties, what class syntax guarantees, and how classes cooperate.

00:11 You’ll port Northbank Tool Library’s Python kit model to JavaScript. Northbank loans kits of tools, each with a label for its checkout desk. Here’s a first taste.

00:22 In Python, Kit’s label property trims every label. The drilling kit assigns a padded label in __init__, and it prints trimmed.

00:33 The JavaScript port keeps the setter and moves that label into a class field, where classes keep per-instance values. It prints the label, spaces and all.

00:45 Keeping that setter in the loop is one of the jobs ahead. Northbank’s Python module describes each kit, like KIT-17, by code and trimmed label. It walks a kit’s tools, as often as you ask, and wraps each description in a tag and an audit mark.

01:02 The checkout app runs JavaScript, so the model moves across.

01:07 You’ll trace property lookup and keep what class syntax guarantees. You’ll implement a language protocol, and choose between class layers and a part the object holds.

01:18 Then you’ll port the kit model.

01:22 You need to know Python’s classes, the MRO and properties. And JavaScript’s classes with getters and setters, Object.create and symbol keys. The examples use Node 26 and Python 3.15.

01:38 Videos mix with text lessons and exercises. Every video has a summary below it. A quiz and a summary close the course. Next up: Following Property Lookup, where you follow the drilling kit’s links one at a time.

Become a Member to join the conversation.