Created
May 18, 2018 15:21
-
-
Save GeeWee/a97b6f32755d61ce21353911a128b919 to your computer and use it in GitHub Desktop.
This file contains 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 getHeatedWater(water, temperature) { | |
// Convert the water to a number | |
const waterAsNumber = parseInt(water, 10); | |
// We spilled some.. | |
const remainingWater = waterAsNumber - 10; | |
// Make sure the temperature is in celcius | |
if (temperature.indexOf("celcius") == -1){ | |
throw new Error("No imperial units allowed!"); | |
} | |
return `Heated ${remainingWater} ml water to ${temperature}`; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment