retrieve last element of array javascript code example
Example 1: get last element of array javascript
var numbers = ["one", "two", "three"];
var lastnumber = numbers[numbers.length - 1];
console.log(lastnumber);
Example 2: get last item of array javascript
get last item of array javascript
Example 3: javascript get last element of array
console.log(2)