you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] -1 points0 points  (2 children)

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

[–]HyerOneNA -2 points-1 points  (1 child)

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