TE
科技回声
首页
24小时热榜
最新
最佳
问答
展示
工作
中文
GitHub
Twitter
首页
Ask HN: Anybody knows why do (0, 0, 1) evaluate to 1 in JavaScript?
1 点
作者
fatih-erikli
超过 1 年前
I understand that in this way:<p>- Tuples not supported, the last item is returned, for a Python programmer perspective.<p>- It's a function call. Function name is not given, so the last argument is returned.
2 条评论
Someone
超过 1 年前
Collapse
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comma_operator" rel="nofollow">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...</a>
评论 #39372302 未加载
cranberryturkey
超过 1 年前
yes. its doing `(false, false, true)` basically. last argument is true.