title: Shape class in javascript?
body: <p>I am trying to make a little shape helper object to help me with the drawing of shapes on html 5 canvas. So far I have;</p>
  
  <pre><code>var Shape = function (config) {
  
      this.initialize(config);
  };
  
  var proto = Shape.prototype;
  
  proto.initialize = function (config) {
  
      this.x = config.x || 0;
      this.y = config.y || 0;
      this.width = config.width || 0;
      this.height = config.height || 0;
      this.color = config.color || false;
  };
  
  /*
      Circle
  */
  
  var Circle = function (config) {
  
      this.initialize(config);
  };
  
  proto = Circle.prototype;
  
  proto = new Shape();
  </code></pre>
  
  <p>But it does not seem to work! When I call to create a new circle like so;</p>
  
  <pre><code>var s1 = new Circle({x: 10, y: 10, width: 10, height: 10, color: "red"});
  </code></pre>
  
  <p>How can I create a base class <code>Shape</code> that will help set up other shapes and assign some common properties that shapes shall have such as, <code>Circle</code>, <code>Rect</code> ect?</p>
  
  <p>I am trying to learn javascript so if the code is way off please explain why and how I can better it, </p>
  
  <p>thanks.</p>