Warunkowy (trójskładnikowy) parametr funkcji operatora
serveDrink(userIsYoungerThan4 ? 'Milk' : userIsYoungerThan21 ? 'Grape Juice' : 'Wine');
Lovely Lizard
serveDrink(userIsYoungerThan4 ? 'Milk' : userIsYoungerThan21 ? 'Grape Juice' : 'Wine');
//Instead of:
var welcomeMessage = 'Hello ' + (username ? username : 'guest');
//Can use:
var welcomeMessage = 'Hello ' + (username || 'guest');