Skip to content

Instantly share code, notes, and snippets.

@GeeWee
Created May 18, 2018 15:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GeeWee/a97b6f32755d61ce21353911a128b919 to your computer and use it in GitHub Desktop.
Save GeeWee/a97b6f32755d61ce21353911a128b919 to your computer and use it in GitHub Desktop.
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