Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

How does ternary operator works ?

let moneyAmount = 80;
let creditCardAmont = 70;

let drink = (moneyAmount > 60 && creditCardAmont > 50) ? 'buy coke' : 'filter water';
console.log(drink)
 
PREVIOUS NEXT
Tagged: #How #ternary #operator #works
ADD COMMENT
Topic
Name
2+2 =