const myNumbers = [100, 200, 300, 400, 500];
// option one
const seconLastNumber = myNumbers.slice(-2, -1)[0]) // 400
// option two
const seconLastNumber = myNumbers[numbers.length - 2]; // 400
const numbers = ["one", "two", "three", "four"];
console.log(numbers[numbers.length - 2]);
const cars = ["benz", "bmw", "volvo", "skoda"];
const lastThree = cars.slice(-3);
console.log(lastThree); // ["bmw", "volvo", "skoda"]