I added the following functions to Array class
Array.prototype.last = function(){
return this[this.length-1];
}
Array.prototype.first = function(){
return this[0];
}
And I added a library called Cosign in my Node project. I have no control over it and it do something like:
for(var k in array) alert(array[k].charAt(0))
But charAt
is a String method. I believe array[k]
is returning my custom function (besides the actual values, that are directory names in my case).
What is the best solution to this?