Answers for "return the last n value in an array"

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

last 10 element of array

System.out.print(Primes1.get(Primes1.size() - 1) + " ");
Posted by: Guest on June-27-2020

Code answers related to "return the last n value in an array"

Code answers related to "Javascript"

Browse Popular Code Answers by Language