js-dojo

3 classes desugared

What this module drills

class adds no new machinery to the language. It is a constructor function, a .prototype object, and a hidden link — the same three pieces from module 01, in formal wear. This module has you build each class feature by hand, then match it to the sugar.

Why it bites

Because the sugar hides a real difference: a method lives on the prototype and is shared by every instance; a field holding an arrow function is copied onto each instance and captures this at construction. They look alike in a class body and behave nothing alike when you patch, override, or spy on them.

Order

01 desugars a whole class; 02 is the method-vs-field trap; 03 builds extends and super by hand. 04 and 05 are the advanced pair — re-classing a live object and partial delegation — and are where the library-patching work in module 04 gets its tools.