Answers for "javascript index is always the last value"

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
1

last element of an array

int[] array = {1,2,3};
System.out.println(array[array.length - 1]);
Posted by: Guest on July-05-2020

Code answers related to "javascript index is always the last value"

Code answers related to "Javascript"

Browse Popular Code Answers by Language