Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. function computeArea(width, height) {
  2. // your code here
  3. return width * height
  4. }
  5.  
  6. /* From here down, you are not expected to
  7. understand.... for now :)
  8.  
  9.  
  10. Nothing to see here!
  11.  
  12. */
  13.  
  14. // tests
  15.  
  16. function testComputeArea() {
  17. let width = 3;
  18. let height = 4;
  19. let expected = 12;
  20. if (computeArea(width, height) === expected) {
  21. console.log('SUCCESS: `computeArea` is working');
  22. } else {
  23. console.log('FAILURE: `computeArea` is not working');
  24. }
  25. }
  26.  
  27. testComputeArea();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement