STARTPOINT_DEV Telegram 95
Полезный метод в JavaScript: Array.at() 🚀

Раньше, чтобы получить элемент по индексу, мы использовали традиционный способ:

const arr = [10, 20, 30, 40, 50];
console.log(arr[0]); // 10
console.log(arr[arr.length - 1]); // 50


Но с методом at() всё стало еще проще и удобнее!

const arr = [10, 20, 30, 40, 50];
console.log(arr.at(0)); // 10
console.log(arr.at(-1)); // 50, элемент с конца массива


Этот метод является частью нового стандарта ECMAScript и поддерживается в современных браузерах.
🔥4



tgoop.com/startpoint_dev/95
Create:
Last Update:

Полезный метод в JavaScript: Array.at() 🚀

Раньше, чтобы получить элемент по индексу, мы использовали традиционный способ:


const arr = [10, 20, 30, 40, 50];
console.log(arr[0]); // 10
console.log(arr[arr.length - 1]); // 50


Но с методом at() всё стало еще проще и удобнее!

const arr = [10, 20, 30, 40, 50];
console.log(arr.at(0)); // 10
console.log(arr.at(-1)); // 50, элемент с конца массива


Этот метод является частью нового стандарта ECMAScript и поддерживается в современных браузерах.

BY Настя Котова // Frontend & Node.js


Share with your friend now:
tgoop.com/startpoint_dev/95

View MORE
Open in Telegram


Telegram News

Date: |

How to Create a Private or Public Channel on Telegram? How to Create a Private or Public Channel on Telegram? SUCK Channel Telegram “Hey degen, are you stressed? Just let it all out,” he wrote, along with a link to join the group. How to create a business channel on Telegram? (Tutorial)
from us


Telegram Настя Котова // Frontend & Node.js
FROM American