**Method 1:**

```
Rectangle.prototype.getArea = function() {
     return this.length * this.width;
};

```

**Method 2:**

```
Rectangle.prototype = {
     getArea: function() {
          return this.length * this.width;
     }
};

```

What are the differences and advantages of each of the methods above?