title: TypeError: Math["floor"] is not a function
body: <p>I'm learning Javascript, so this question may seem ludicrous for most JS coders. I'm reading Javascript: The good parts, and I can't make this piece of code work:</p>
  
  <pre><code>Function.prototype.method = function(name,func){
      this.prototype[name] = func;
      return this;
  }
  Number.method('integer', function(){
      return Math[ this &lt;0? 'ceiling' : 'floor'](this);
  });
  document.writeln(Math.floor(3.4)+"");
  document.writeln((-10/3).integer());
  </code></pre>
  
  <p>As you probably guessed it, the first document.writeln function displays "3" as it should be, but the second one displays nothing and the error is: "TypeError: Math["floor"] is not a function" althoug it is indeed a function.</p>
  
  <p>I'm pretty sure this is stupid, but I don't find why it doesn't work. Thanks for your time.</p>
  
  <p>Fabien</p>