Javascript Array extension
<p>Just wonder.
I have extended javascript Array object using its prototype as follows:</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;script type="text/javascript"&gt;
  function SomeMethod(){
  alert('Hello');
  }
  if(typeof Array.prototype.SomeMethod ==='undefined' ){
    Array.prototype.SomeMethod = SomeMethod;
  }
  var ax=new Array("A","B","C");
  for(var i in ax){
    document.write(ax[i]);
  }
&lt;/script&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>The result will be:</p>

<pre><code>ABCfunction SomeMethod() { alert("Hello"); }
</code></pre>

<p>EDIT:
Although I have already found the answer I feel the necessity to add some
more information so it would be clearer for others.</p>
