Created
August 30, 2023 13:46
-
-
Save codeperfectplus/46f3dfcf01f091dbcb65638ca503b432 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Calculate the area of a rectangle. | |
| * | |
| * length: The length of the rectangle. | |
| * width: The width of the rectangle. | |
| * | |
| * Return a number denoting the rectangle's area. | |
| **/ | |
| function getArea(length, width) { | |
| let area; | |
| // Write your code here | |
| area = length * width; | |
| return area; | |
| } | |
| /** | |
| * Calculate the perimeter of a rectangle. | |
| * | |
| * length: The length of the rectangle. | |
| * width: The width of the rectangle. | |
| * | |
| * Return a number denoting the perimeter of a rectangle. | |
| **/ | |
| function getPerimeter(length, width) { | |
| let perimeter; | |
| // Write your code here | |
| perimeter = 2 * (length + width); | |
| return perimeter; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment