Answers for "how to grab the last 3 output from an array"

2

how to print the last element of an array

var array = [1,2,3,4,5];
var last_element = array[array.length - 1];
console.log(last_element); //Expected Output: 5
Posted by: Guest on January-20-2021
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 "how to grab the last 3 output from an array"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language