JavaScript

Calculate Area and Perimeter of Rectangle in JavaScript

Perimeter: The perimeter is the length of the outline of a shape. To find the perimeter of a rectangle or square you have to add the lengths of all the four sides. x is in this case the length of the rectangle while y is the width of the rectangle.




Area: The area is measurement of the surface of a shape. To find the area of a rectangle or a square you need to multiply the length and the width of a rectangle or a square.

 

Result:

JavaScript Code:

 

 

About the author

admin

1 Comment

Leave a Comment