Advertisement
Guest User

Untitled

a guest
Feb 21st, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. // Area of a Rectangle
  2.  
  3. function computeArea(width, height) {
  4. return width * height;
  5. }
  6.  
  7. function testComputeArea() {
  8. var width = 3;
  9. var height = 4;
  10. var expected = 12;
  11. if (computeArea(width, height) === expected) {
  12. console.log('SUCCESS: `computeArea` is working');
  13. }
  14. else {
  15. console.log('FAILURE: `computeArea` is not working');
  16. }
  17. }
  18. testComputeArea();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement