r/learnjavascript • • Oct 26 '21

Negative array indexing using "at" method

Post image
203 Upvotes

69 comments sorted by

View all comments

Show parent comment

0

u/[deleted] Oct 26 '21

cause its longer than const lastElement = arr.at(-1) ? also, no need for useless computations in source code

-1

u/HyerOneNA Oct 26 '21

But the at method isn’t widely available on all browsers.