SHARE
TWEET

Untitled

a guest Mar 20th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top