Answers for "second last item in array javascript"

38

javascript last element of array

let arr = [1,2,3]
arr[arr.length - 1] //returns last element in an array
Posted by: Guest on June-16-2020
0

javascript get second last element of array

const numbers = ["one", "two", "three", "four"];
console.log(numbers[numbers.length - 2]);
Posted by: Guest on September-06-2020

Code answers related to "second last item in array javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language