title: Error in prototype syntax of javascript class
body: <pre><code>class Rectangle {
      constructor(w, h) {
          this.w = w;
          this.h = h;
      }
  }
  
  Rectangle.prototype.area = funcion() {
      var area = this.w * this.h;
      return area;
  }
  
  class Square extends Rectangle {
     constructor(w){
         this.w=w;
         this.h=w;
     }
  }
  </code></pre>
  
  <p>When I try to run this code, it gives following error:</p>
  
  <blockquote>
    <p>solution.js:10</p>
    
    <p>Rectangle.prototype.area=funcion() {</p>
    
    <p>^ SyntaxError: Unexpected token {</p>
  </blockquote>