As you know, an Array's prototype can be modified to give it custom methods.
Array.prototype.foo = function () {}
But those methods then apply to ALL Arrays anywhere in the entire application.
Is there a way to accomplish something like this:
let dArray = [];
dArray.prototype.foo = function () {}
With the result being that only the dArray instance has that custom method?
Obviously, this way will not work, but is there another way to achieve that result?