🔥 Use JavaScript's new array.at()

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

I didn’t know it flooded numbers, but I learned about this function a month ago and it’s amazing. no more array.length-1 for me

aarond
Автор

I love learning in all these bite sized chunks. Very cool snippets

pauldudley
Автор

What is the extension you use to show the value of the variable in the side like that?

MrPeepa
Автор

So array.at supports negative numbers, where tops[-1] is not supported. Is that the only difference?

joshevenson
Автор

ah the negative indexes remind me of python

gigachad
Автор

How was this not a thing from the get go ???

ko-Daegu
Автор

so its the same as [ ] except for the minus part?

yanikkendler
Автор

It's like the index function right

Ker
Автор

Quick warn, this will crash on Safari 15.3 or older, I literally just fixed this issue... BE WARNED

ariell
Автор

What extension he's using to preview the output per line beside it?

edmondesquilon
Автор

No, it's not supported in all the browsers. Please don't listen to this. Not everyone has the latest Safari. It's not evergreen.

PeterBernardin