JSFiddle - React, Tailwind, and code Playground
JavaScript
var OneInstance = function(numberAdd) {
if(this.numbers === undefined) this.numbers = [];
this.numbers.push(numberAdd);
this.showNumbers = function() {
alert(this.numbers);
}
return this;
}
OneInstance(1).showNumbers();
OneInstance(1).showNumbers();