Answers for "js array indexing how to index last element"

34

javascript last index

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 "js array indexing how to index last element"

Code answers related to "Javascript"

Browse Popular Code Answers by Language