Search
Use the slice() method to copy the first two elements from the names array into namesSubArray.
slice()
names
namesSubArray
For example: