only list last 5 elements in array javascript code example
Example 1: last element from list javascript
const lastItem = colors[colors.length - 1]
Example 2: last 10 element of array
System.out.print(Primes1.get(Primes1.size() - 1) + " ");
const lastItem = colors[colors.length - 1]
System.out.print(Primes1.get(Primes1.size() - 1) + " ");