Created
November 10, 2018 21:55
-
-
Save HamidOsouli-zz/f2ee36c83a2ea186acb7d972b20bce63 to your computer and use it in GitHub Desktop.
this is the multi conditional with ternary operator for Javascript
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
let i = true; | |
let j = 14; | |
ans = i ? (j > 10 ? (j%7 === 7 ? 14 : 54 ) : 66) : 99; | |
// returns 14 because i === true && j > 10 && j%7 === 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment