I really don't know what to google to find out the name for this syntax:
(1,2)
seems to evaluate to 2
(1,2,3,"cake")
seems to evaluate to "cake"
.
etc
This is sometimes useful in anonymous functions in Array.reduce
, where you need to perform a sequence of operations (say an increment) and also return the element on the right.
But where can I read about it and what's it called?