js last x records of array code example Example: last 10 element of array System.out.print(Primes1.get(Primes1.size() - 1) + " ");