Last active
January 26, 2018 22:31
-
-
Save arctic-pie/7484e156a5cd0f231f8e1d636772530e to your computer and use it in GitHub Desktop.
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
var temperature = 15; | |
var itsRaining = false; | |
var minutes; | |
var MIN_TEMP = 0; | |
var MAX_TEMP = 35; | |
var PERFECT_TEMP = 20; | |
var conditionsAreNotSatisfied = temperature < MIN_TEMP || temperature > MAX_TEMP || itsRaining; | |
if (conditionsAreNotSatisfied) { | |
minutes = 0; | |
} else { | |
minutes = PERFECT_TEMP - Math.abs(PERFECT_TEMP - temperature) | |
} | |
console.log(minutes); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment