Answers for "how to take the last 4 members of an array in javascript"

38

javascript last element of array

let arr = [1,2,3]
arr[arr.length - 1] //returns last element in an array
Posted by: Guest on June-16-2020
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

Code answers related to "how to take the last 4 members of an array in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language