Answers for "how to separate last index from array in javascript"

4

javascript split get last element

a = "hello.dear.friends"
a.split(".").pop()
> "friends"
Posted by: Guest on February-18-2021
29

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

Code answers related to "how to separate last index from array in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language