JavaScript 2022 - New Features - Part 1
Using at() function
The at() function is used for extracting a value at a given index in an array. The index can be given as negative or positive value.
// at method
let arr= [1,2,3,4];
console.log(arr.at(1), arr.at(-1), arr.at(-2)); // 2,4,3
let ar...
mahavir.hashnode.dev2 min read