Is there a way in Javascript to make an Object containing expressions of both classes and subclasses of it? I tried this way, but I guess I can't refer to the superclass this way.
const myClasses = {
'animal': class {
a;
b;
constructor(x, y) {
this.a = x;
this.a = y;
}
},
'dog': class extends animal {
constructor(d, e) {
super(d, e);
}
bark () {
console.log('woof!');
}
}
}