Last active
December 14, 2018 16:16
-
-
Save StrykerKent/1b29dc8cb32abdcd57c293a2865d1123 to your computer and use it in GitHub Desktop.
Example of an arrow function with a conditional ternary if statement in JavaScript.
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
var arrowFunction = x => x % 2 == 0 ? "even" : "odd"; | |
for(var i = 0; i < 100; i++) { | |
console.log([i] + " " + arrowFunction([i])); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment