JSFiddle - React, Tailwind, and code Playground

by Alexander

JavaScript

console.clear();

const a = [1, 2, 3, 4, 5, 6, 7, 8, 9];
a.length = 4;

const [last] = a.slice(-1)
console.log(last);