Answers for "get last item in array without using length"

26

js take last item in array

const heroes = ["Batman", "Superman", "Hulk"];
const lastHero = heroes.pop(); // Returns last elment of the Array
// lastHero = "Hulk"
Posted by: Guest on March-16-2020
0

Get last item on js array

const lastItem = colors[colors.length - 1]
Posted by: Guest on April-16-2021

Code answers related to "get last item in array without using length"

Code answers related to "Javascript"

Browse Popular Code Answers by Language