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