Created
          March 10, 2018 01:28 
        
      - 
      
 - 
        
Save liseferguson/3d1ac7e3066492273bcf3e1b405d433f to your computer and use it in GitHub Desktop.  
    Fahrenheit and Celcius temperature conversions
  
        
  
    
      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 celsToFahr(celsTemp) { | |
| return celsTemp * 9/5 + 32; | |
| } | |
| function fahrToCels(fahrTemp) { | |
| return (fahrTemp - 32) * 5/9; | |
| } | |
| /* From here down, you are not expected to | |
| understand.... for now :) | |
| Nothing to see here! | |
| */ | |
| // tests | |
| function testConversion(fn, input, expected) { | |
| if (fn(input) === expected) { | |
| console.log('SUCCESS: `' + fn.name + '` is working'); | |
| return true; | |
| } else { | |
| console.log('FAILURE: `' + fn.name + '` is not working'); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment