how to print last element of array in console javascript code example
Example: get last item in array javascript
var colors = ["black", "white", "red", "yellow"];
var yellow = colors[colors.length - 1];
var colors = ["black", "white", "red", "yellow"];
var yellow = colors[colors.length - 1];