Answer:
function Rectangle(width=1, height= 1 ) {
this.width= width;
this.height= height;
this.getArea= ( ) = > {return width * height};
this.getPerimeter= ( ) = >{ return 2( height + width)};
}
var rectangleOne= new Rectangle(4, 40)
var rectangleTwo= new Rectangle(3.5, 35.9)
console.log(rectangleOne.width, rectangleOne.height, rectangleOne.getArea( ), rectangleOne.getPerimeter( ) )
console.log(rectangleTwo.width, rectangleTwo.height, rectangleTwo.getArea( ), rectangleTwo.getPerimeter( ) )
Step-by-step explanation:
This is a Javascript class definition with a constructor specifying arguments with default values of one for both width and height, and the getArea and getPerimeter methods.