r/learnjavascript • • Oct 26 '21

Negative array indexing using "at" method

Post image
203 Upvotes

69 comments sorted by

View all comments

28

u/HyerOneNA Oct 26 '21

Why use the at method when you can just use square bracket notation?

12

u/nullol Oct 26 '21

No idea why you're being downvoted for asking a genuine question in r/learnjavascript - I am sure a lot of new developers would be confused by this as well.

7

u/HyerOneNA Oct 26 '21

Yup, idk. A lot of no lifers in here.

3

u/nullol Oct 26 '21

I think because it's Reddit people forget or don't realize what sub they're on and assume you're being intentionally contrary rather than trying to learn something new (I have been a JS developer for 8yrs and I never knew about this in other languages so TIL as well).

2

u/HyerOneNA Oct 26 '21

I’m coming from C++, so yeah. It’s a lil different lol.