Settings

Theme

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

1 points by fatih-erikli 2 years ago · 3 comments · 1 min read


I understand that in this way:

- Tuples not supported, the last item is returned, for a Python programmer perspective.

- It's a function call. Function name is not given, so the last argument is returned.

Someone 2 years ago

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

cranberryturkey 2 years ago

yes. its doing `(false, false, true)` basically. last argument is true.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection