// package
array-last
type: "module"
// preferences
// replacements (1)
snippet::array-last
Simple or drop-in replacementThis package is no longer necessary. You can use `arr.at(-1)` if supported or `arr[arr.length - 1]` to get the last element of an array.
// example
const last = (arr) => arr.at(-1);
// or in older environments
const lastLegacy = (arr) => arr[arr.length - 1];