Answers for "how to gtoget last emelent of array in java script"

25

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
1

last item in array javascript

// Find the last item in an array.
arrayName[arrayName.length - 1]
Posted by: Guest on September-16-2020

Code answers related to "how to gtoget last emelent of array in java script"

Code answers related to "Javascript"

Browse Popular Code Answers by Language