Day 4: Create a Rectangle Object

Problem Link

Solution

rectObject.js
this.length = a;
this.width = b;
this.perimeter = 2 * (a + b);
this.area = a * b;

Last updated

Was this helpful?