Skip to content

Instantly share code, notes, and snippets.

@codeperfectplus
Created August 30, 2023 13:46
Show Gist options
  • Select an option

  • Save codeperfectplus/46f3dfcf01f091dbcb65638ca503b432 to your computer and use it in GitHub Desktop.

Select an option

Save codeperfectplus/46f3dfcf01f091dbcb65638ca503b432 to your computer and use it in GitHub Desktop.
/**
* 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