Skip to main content
added 93 characters in body
Source Link
Penny Liu
  • 18k
  • 5
  • 89
  • 109

I'm using .at().at() most of the time:

let arr = [1, 2, 3, 4, 5];
let lastElement = arr.at(-1);
console.log(lastElement);

I'm using .at() most of the time:

let arr = [1, 2, 3, 4, 5];
let lastElement = arr.at(-1);
console.log(lastElement);

I'm using .at() most of the time:

let arr = [1, 2, 3, 4, 5];
let lastElement = arr.at(-1);
console.log(lastElement);

Source Link
mrconcerned
  • 2.2k
  • 2
  • 18
  • 30

I'm using .at() most of the time:

let arr = [1, 2, 3, 4, 5];
let lastElement = arr.at(-1);
console.log(lastElement);