diff --git a/source/_posts/javascript.md b/source/_posts/javascript.md index 66920ab..cbc62cf 100644 --- a/source/_posts/javascript.md +++ b/source/_posts/javascript.md @@ -146,9 +146,11 @@ if (isMailSent) { ### Ternary Operator ```javascript +// The ternary operator is a concise way to write an if-else statement in a single line: condition ? exprIfTrue : exprIfFalse. + var x = 1; -// => true +// true, (condition) ? value_if_true : value_if_false result = x == 1 ? true : false; ```