how to access last object of an array code example
Example: javascript get last element of array
var foods = ["kiwi","apple","banana"];
var banana = foods[foods.length - 1]; // Getting last element
var foods = ["kiwi","apple","banana"];
var banana = foods[foods.length - 1]; // Getting last element