title: Using 'this' in a function prototype - JavaScript
body: <p>I am trying to understand some prototypical concepts of JavaScript which I don't use quite often. Here I have two same methods one for Array another for Function. One works, another not. Could you please explain what is the difference here?</p>
  
  <pre><code>var arr = ['test'];
  var string = 'test';
  
  Array.prototype.print = function(){
          console.log(this);
  }
  Function.prototype.print = function () {
          console.log(this);
  }
  
  arr.print(); // logs the arr with value 'test'
  string.print(); //logs string.print is not a function
  </code></pre>