1const myNumbers = [100, 200, 300, 400, 500];
2// option one
3const seconLastNumber = myNumbers.slice(-2, -1)[0]) // 400
4
5// option two
6const seconLastNumber = myNumbers[numbers.length - 2]; // 400
1const numbers = ["one", "two", "three", "four"];
2console.log(numbers[numbers.length - 2]);