Добавить
Уведомления

Get the last item of an array with the array.at() method

Selecting the last item of an array or any item via its negative index had always been a hack in JavaScript but this has changed with the introduction of the Array .at() method in ES2020. In this video, I explained how to use the JavaScript Array .at() method for selecting any time via its negative index I also talked about the different ways this can be done without the Array .at() method. #javascript #tutorial #arrray 0:00 Intro 1:12 Array Index 3:18 Getting the last item of an array with Array.pop() 4:46 Getting the last item of an array with Array.slice() 6:12 Getting the last item of an array with Array.length 8:05 Getting the last item of an array with Array.at() 10:15 Browser Compatibility

12+
16 просмотров
2 года назад
12+
16 просмотров
2 года назад

Selecting the last item of an array or any item via its negative index had always been a hack in JavaScript but this has changed with the introduction of the Array .at() method in ES2020. In this video, I explained how to use the JavaScript Array .at() method for selecting any time via its negative index I also talked about the different ways this can be done without the Array .at() method. #javascript #tutorial #arrray 0:00 Intro 1:12 Array Index 3:18 Getting the last item of an array with Array.pop() 4:46 Getting the last item of an array with Array.slice() 6:12 Getting the last item of an array with Array.length 8:05 Getting the last item of an array with Array.at() 10:15 Browser Compatibility

, чтобы оставлять комментарии