Created
February 12, 2020 21:26
-
-
Save willwalker753/1b1b2a08c4cfed06d65183aaa8e8953c to your computer and use it in GitHub Desktop.
Area of a Rectangle
This file contains 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
function computeArea(width, height) { | |
let area = width*height; | |
return area | |
} | |
let width = 3; | |
let height = 4; | |
console.log(computeArea(width,height)); | |
function testComputeArea() { | |
let width = 3; | |
let height = 4; | |
let expected = 12; | |
if (computeArea(width, height) === expected) { | |
console.log('SUCCESS: `computeArea` is working'); | |
} else { | |
console.log('FAILURE: `computeArea` is not working'); | |
} | |
} | |
testComputeArea(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment