Created
          March 10, 2018 01:12 
        
      - 
      
 - 
        
Save liseferguson/66c17f03b82e1e6502940445840ec471 to your computer and use it in GitHub Desktop.  
    Area function - Computes area of rectangle
  
        
  
    
      This file contains hidden or 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) { | |
| return width* height; | |
| } | |
| /* From here down, you are not expected to | |
| understand.... for now :) | |
| Nothing to see here! | |
| */ | |
| // tests | |
| 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