Created
February 17, 2019 18:19
-
-
Save micheleriva/fd35bdf1375c1f3430bb06f8096deceb 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
[1, 2, 3, 4, 5].map((item) => { | |
const evenOrOdd = item % 2 > 0 ? "odd" : "even"; | |
console.log(`${item} is ${evenOrOdd}`) | |
return evenOrOdd; | |
}) | |
// 1 is odd | |
// 2 is even | |
// 3 is odd | |
// 4 is even | |
// 5 is odd | |
// ["odd", "even", "odd", "even", "odd"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment