TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Anybody knows why do (0, 0, 1) evaluate to 1 in JavaScript?

1 pointsby fatih-erikliover 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&#x27;s a function call. Function name is not given, so the last argument is returned.

2 comments

Someoneover 1 year ago
<a href="https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;JavaScript&#x2F;Reference&#x2F;Operators&#x2F;Comma_operator" rel="nofollow">https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;JavaScript&#x2F;Refe...</a>
评论 #39372302 未加载
cranberryturkeyover 1 year ago
yes. its doing `(false, false, true)` basically. last argument is true.