условная (тройная) параметр функции оператора
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');