
array.at() – Returns the element at the given index. Supports negative indexing.
๐ Syntax
element = array.at(index);
๐งช Example
const arr=['a','b','c']; arr.at(-1); // 'c'
array.at() – Returns the element at the given index. Supports negative indexing.
element = array.at(index);
const arr=['a','b','c']; arr.at(-1); // 'c'
Comments
Post a Comment