select 3 out of 10 lelement from an array js code example Example: array index javascript show only first 2 elements array.slice(0, n);