JSFiddle - React, Tailwind, and code Playground

by nevkatz

JavaScript

class Sprite {
 constructor(id) {
     this.id = id;
 }
}
class Enemy extends Sprite {
 constructor(id) {
     super();
     this.id = id;
 }
}
Object.assign(Enemy, Sprite);
var mySprite = new Enemy(1);

console.log(Object.getPrototypeOf(mySprite));