I am working on react app. There is problem that some third party libraries extend the Array.prototype
. They add extra properties to Array.prototype.
So, In my code whenever I define
var myArray = [];
console.log(myArray); // those extended coming with it.
How should I avoid this.
One way I tried using this way:
function myArray()
{
this.array = new Array();
return this.array;
}
var myArray = myArray(); //but no luck :(