Javascript overriding/adding methods to the prototype
<p>Basically, I want to know how/what's the difference between overriding/adding methods on instances of objects vs  methods on the 'Class' instance of JS objects (yes class isn't the right word, not sure what is though).</p>

<p>For example, why doesn't this work?</p>

<pre><code>Date.prototype.now= function (){
    return 23;
}

$('#foo').append(Date.now());    
</code></pre>

<p>And yet, this does?</p>

<pre><code>Array.prototype.indexOf = function(){
    return 23;
}
var bar = Array();
bar[0] = "a";
$('#bar').append(bar.indexOf("a"));
</code></pre>

<p><a href="http://jsfiddle.net/tad604/fMWKA/2/" rel="nofollow">http://jsfiddle.net/tad604/fMWKA/2/</a></p>
