js get last element typed in console 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: javascipt get last element of array
const arr = [1,2,3] ;
console.log(arr[arr.length - 1]);