return last item from array in js 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];