I have a prototype object in Javascript, when I initialise a new instance of the prototype and update properties in the prototype, it updates for all elements. I understand that
Define the array on the instance instead of on the prototype:
function Test() { this.array = []; } Test.prototype.add = function (value) { this.array.push(value) }