Area of Rectangle

Report a typo

Create a class called Rectangle with a constructor that sets width and height properties. Inside the constructor, add a calculateArea method that returns the area of the rectangle.

Hint: You can find the area of a rectangle by multiplying width by height.

Sample Input 1:

5 10

Sample Output 1:

Area: 50
Write a program in JavaScript
class Rectangle {
// Write your code here
}
___

Create a free account to access the full topic