Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Don't use functions as callbacks unless they're designed for it. Parent comment
array.map((val, index, {length}) => if (index + 1 == length) { alert("last element") } else { alert("element #"+index) })
There are no comments on this comment yet.
array.map((val, index, {length}) => if (index + 1 == length) { alert("last element") } else { alert("element #"+index) })