• Top
  • New

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

by fatih-erikli on 2/14/2024, 4:53:17 PM with 3 comments
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.

  • by Someone on 2/14/2024, 4:57:23 PM

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

  • by cranberryturkey on 2/14/2024, 5:01:34 PM

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