JSFiddle - React, Tailwind, and code Playground

JavaScript

// Hi, thanks for your time :-)

function Node() {
    console.log('running node constructor');
}

GameObject.prototype = new Node();
GameObject.prototype.constructor=GameObject;

function GameObject() {
    
    // Call to "super()"
    Node.call(this);
    
    console.log('running gameobject constructor');
    this.animations = new Array();
}

Redhead.prototype = new GameObject();
Redhead.prototype.constructor=Redhead;

var idx = 0;

function Redhead() {

    // Call to "super()"
    GameObject.call(this);
    
    console.log('running player constructor');
    this.animations['running'] = ("myRunningAnim" + idx++);
}

var player1 = new Redhead();
var player2 = new Redhead();
var player3 = new Redhead();

console.log('Must be item 0, is actually ' + player1.animations['running']);
console.log('Must be item 1, is actually ' + player2.animations['running']);
console.log('Must be item 2, is actually ' + player2.animations['running']);