title: call a javascript prototype object method from main class
body: <pre><code>var log = function (e, clear) {
    if (clear === true) {
      this.clear();
    }
    console.log(e);
  };
  log.prototype = {
    clear: function () {
      console.clear();
    }
  };
  </code></pre>
  
  <p>i'm calling like this.</p>
  
  <pre><code>log('hi', true);
  </code></pre>
  
  <p>it says clear is undefined. I also tried log.clear(); but same undefined.</p>