Javascript add method to object
<p>Suppose I have a <code>Foo</code> object</p>

<p>How can I extend this object by adding a <code>bar()</code> method and also ensure that future instances of <code>Foo</code> have this method?</p>
