MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/learnjavascript/comments/qg23w3/negative_array_indexing_using_at_method/hi8mfta/?context=3
r/learnjavascript • u/jd_300 • Oct 26 '21
69 comments sorted by
View all comments
6
array.reverse()[0]
5 u/NekkidApe Oct 27 '21 In case anyone is using this... It's mutating the original array 1 u/Dodgy-Boi Oct 27 '21 I saw a huge battle about index. And came up with another solution (I honestly tried to make it as ridiculous and/or unique as possible). 2 u/NekkidApe Oct 27 '21 Maybe reverse and shift then for extra points
5
In case anyone is using this... It's mutating the original array
1 u/Dodgy-Boi Oct 27 '21 I saw a huge battle about index. And came up with another solution (I honestly tried to make it as ridiculous and/or unique as possible). 2 u/NekkidApe Oct 27 '21 Maybe reverse and shift then for extra points
1
I saw a huge battle about index. And came up with another solution (I honestly tried to make it as ridiculous and/or unique as possible).
2 u/NekkidApe Oct 27 '21 Maybe reverse and shift then for extra points
2
Maybe reverse and shift then for extra points
reverse
shift
6
u/Dodgy-Boi Oct 26 '21
array.reverse()[0]