//Works with new class Counter { static instance; constructor(x){ this.x = x if(!Counter.instance) Counter.instance = this; return Counter.instance; } counter = 0; getCount() { return this.counter; } increment() { this.counter = this.counter + 1; return this.counter; } } module.exports = Counter;