Answers for "how to get the last value of an array in javascript"

29

Javascript get last item in array

var colors = ["red","blue","green"];
var green = colors[colors.length - 1]; //get last item in the array
Posted by: Guest on July-25-2019

Code answers related to "how to get the last value of an array in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language