TE
TechEcho
Home
24h Top
Newest
Best
Ask
Show
Jobs
English
GitHub
Twitter
Home
Ask HN: Anybody knows why do (0, 0, 1) evaluate to 1 in JavaScript?
1 points
by
fatih-erikli
over 1 year ago
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 comments
Someone
over 1 year ago
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
over 1 year ago
yes. its doing `(false, false, true)` basically. last argument is true.