title: Can someone explain to me why this inheiritance in javascript doesnt work?
body: <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script&gt;
  
  function SuperClass()
  {
      var self = this;
      self.someVariable = true;
  }
  function SubClass()
  {
      var self = this;
      self.name = "Sub";
  }
  SubClass.prototype = SuperClass;
  
  var sub = new SubClass();
  
  alert("This is a sub class with name " + sub.name + " and variable " + sub.someVariable);
  
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>This is a sub class with name Sub and variable undefined
  </code></pre>
  
  <p>So how come sub class doesnt have someVariable? I thought thats the whole point of prototyping.</p>