Created
February 16, 2016 17:00
-
-
Save Eunoia/bb1f5ec4f8585555ca8d to your computer and use it in GitHub Desktop.
Two ways to do the same thing.
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
// shorter | |
color = details.leftToPurchase < 0 ? 'red' : '#534F4E'; | |
// more clear | |
if(details.leftToPurchase < 0){ | |
color = 'red'; | |
} else { | |
color = '#534F4E'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment