get the last value in an array javascript 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