1
JavaScriptAdvanced#event-loop#async
Classes are syntactic sugar over prototypes, but they are not hoisted for use, always run in strict mode, must be called with new, and support extends/super and #private fields.
class Animal {
#id = 1;
constructor(name){ this.name = name; }
speak(){ return `${this.name} speaks`; }
}
class Dog extends Animal { speak(){ return super.speak() + ' woof'; } }