标签: javascript jquery
这个return语句是如何工作的?
return [weekend, !weekend ? 'myweekend' : ''];
答案 0 :(得分:0)
如果weekend为假/ falsy,则会返回[weekend, 'myweekend'],否则[weekend, '']
weekend
[weekend, 'myweekend']
[weekend, '']