JS pre-ES6 Demo
A quick p5.js sketch that demonstrates object-oriented JavaScript programming in the dark ages (aka, pre-2015).
This short exercise made me truly appreciate modern JS, and the fact that we don't have to write code like this anymore 🥲.
Check out the code in the p5js web editor! A few of the cutting-edge features to check out:
- Creating instance methods by assigning functions to the
prototypeof the Constructor function, egOrchestrator.prototype.createShapes = () => {...} - Creating static fields and methods by adding properties directly to the Constructor function, e.g.
Circle.instances = [] - Adding behavioral Mix-ins using
Object.assign(rotation_mixin)
To see something slightly less unimpressive, see my JS pre-ES6 Demo.