Answers for "lastindex in arr in js"

34

last index array javascript

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

reach last array js

if (locArray.at(-1) === 'index.html') {
   // do something
} else {
   // something else
}
Posted by: Guest on October-29-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language