title: Can a javascript object override its parent method and call it in that method?
body: <p>Imagine the following scenario:</p>
  
  <p>I have two classes: <code>Parent</code> and <code>Child</code>. Parent has a method <code>foo()</code>. <code>Child</code> wants to override <code>foo()</code>, and within do whatever <code>foo()</code> did in <code>Parent</code>'s <code>foo()</code>.</p>
  
  <p>In any other programming language i would just do something like </p>
  
  <pre><code>foo(){
    super.foo();
    //do new stuff
  }
  </code></pre>
  
  <p>But in javascript there's no such thing. Here's a short version of my code:</p>
  
  <pre><code>function Parent( name, stuff ){
    this.name = name;
    this.stuff = stuff;
  }
  
  Parent.prototype = {        
    foo: function(){ 
      console.log('foo');
    }
  }
  
  function Child(name, stuff, otherStuff ){
    Parent.call(this, name, stuff);
    this.otherStuff = otherStuff;
  }
  
  Child.prototype = new Parent();
  Child.prototype.foo = function(){
  
    ???//I want to call my parents foo()! :(
    console.log('bar');
  
  }
  </code></pre>
  
  <p>What I want to achieve is that when an instance of <code>Child</code> calls <code>foo()</code> i can get <code>foobar</code> in the console. </p>
  
  <p>Thanks!</p>
  
  <p>PS: please, no JQuery, PrototypeJS, ExtJs, etc... This is a Javascript project and also a learning exercise. Thank you.</p>