r/learnjavascript • • Oct 26 '21

Negative array indexing using "at" method

Post image
203 Upvotes

69 comments sorted by

View all comments

6

u/Dodgy-Boi Oct 26 '21

array.reverse()[0]

2

u/[deleted] Oct 27 '21

Too slow, unfortunately. Accessing a value in an array using an index should be in O(1) time complexity.

2

u/Dodgy-Boi Oct 27 '21

I am front end. My calculations are happening on client. I don’t care about either users with old devices nor your O nor your o nor * of yours; all I care about is the ( . Y . ) (not necessarily yours)

partially /s