title: Creating a Class and calling on it's properties (javascript)
body: <p>So the idea is to create a class Animal and the set properties to it as a new object </p>
  
  <p>Here is what I have:</p>
  
  <pre><code>var name;
  var type;
  function Animal(name,type){
    this.type = type,
    this.name = name,
    toString = function(){return this.name + "is a " + this.type;}
  };
  
  var cat = new Animal('Max','cat');
  cat.type;
  </code></pre>
  
  <p>everytime I run it - I seem to fail at the toString part? Pretty new and trying to learn this - is there something I am missing?</p>