Answers for "how to extract last value from loop js"

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
0

how to get last element of array in javascript

console.log('arr')
Posted by: Guest on February-04-2022

Code answers related to "how to extract last value from loop js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language