Hacker News new | ask | show | jobs
by kuschku 1961 days ago
> I'm most curious as to who uses the last argument in the JS map function!

array.map((val, index, {length}) => if (index + 1 == length) { alert("last element") } else { alert("element #"+index) })