title: Extending an Object in Javascript
body: <p>I am currently transforming from <code>Java</code> to <code>Javascript</code>, and it's a bit hard for me to figure out how to extend objects the way I want it to do.</p>
  <p>I've seen several people on the internet use a method called extend on object. The code will look like this:</p>
  <pre><code>var Person = {
     name : 'Blank',
     age  : 22
  }
  
  var Robot = Person.extend({
     name : 'Robo',
     age  : 4
  )}
  
  var robot = new Robot();
  alert(robot.name); //Should return 'Robo'
  </code></pre>
  <p>Does anyone know how to make this work?
  I've heard that you need to write</p>
  <pre><code>Object.prototype.extend = function(...);
  </code></pre>
  <p>But I don't know how to make this system work. If it is not possible, please show me another alternative that extends an object.</p>