Find last element of an array

PHOTO EMBED

Sun Jun 26 2022 16:14:13 GMT+0000 (Coordinated Universal Time)

Saved by @Floony #javascript

const data = ['a', 'b', 'c', 'd'],
      [last] = data.slice(-1);

console.log(last);
content_copyCOPY

https://stackoverflow.com/questions/60409137/how-to-find-last-element-of-an-array-without-modifying-source-array-in-vanilla-j