📜  三元运算符返回日期问候语 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:40.347000             🧑  作者: Mango

代码示例1
var now = new Date();
var greeting = "Good" + ((now.getHours() > 17) ? " evening." : " day.");