javascript get only n number of array code example Example: get n number of elements from array javascript const slicedArray = array.slice(0, n);