How to prevent custom methods from appearing in For loop?
<p>I added the following functions to Array class </p>

<pre><code>Array.prototype.last = function(){
     return this[this.length-1];
 }

Array.prototype.first = function(){
     return this[0];
 }
</code></pre>

<p>And I added a library called Cosign in my Node project. I have no control over it and it do something like:</p>

<pre><code>for(var k in array) alert(array[k].charAt(0))
</code></pre>

<p>But <code>charAt</code> is a String method. I believe <code>array[k]</code> is returning my custom function (besides the actual values, that are directory names in my case).</p>

<p>What is the best solution to this?</p>