Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

ternary operator in javascript

let amount = 50;
let food = amount > 100 ? 'buy coka-cola' : 'buy just a water bottle';
console.log(food)
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #ternary #operator #javascript
ADD COMMENT
Topic
Name
3+8 =