title: Javascript prototype inheritance not working
body: <p>This is not the actual project i am working on but simple code to understand what am i doing wrong.</p>
  
  <p>I have created a object named <strong>NumSelector</strong> and trying to use method <strong>validator</strong> which i have inherited using prototype. I get error <strong>"validator is not defined"</strong></p>
  
  <pre><code>function NumSelector(num)
  {
      if(validator(num))
        console.log("NUmber is positive");
      else
        console.log("Number s negative");
  }
  
  NumSelector.prototype.validator = function(num)
  {
    if(num&gt;0)
      return true;
    else
      return false;
  };
  </code></pre>