JSFiddle - React, Tailwind, and code Playground

HTML

Look in the console.

JavaScript

class Example {
}
Example.prototype.sharedObject = {
	counter: 0
};
const e1 = new Example();
const e2 = new Example();
console.log(e2.sharedObject.counter); // 0
++e1.sharedObject.counter;
console.log(e2.sharedObject.counter); // 1