So if you want to get the first n number of items from Array then pass starting index 0 and stop index value what you want.
Example of getting the first N number of elements from an array
In this example original array is not modified in this operation.
Do comment if you have other way to do it or have any doubts on this question.
Note: The All JS Examples codes are tested on the Safari browser (Version 12.0.2) and Chrome.
OS: macOS 10.14 Mojave
Code: HTML 5 Version
Degree in Computer Science and Engineer: App Developer and has multiple Programming languages experience. Enthusiasm for technology & like learning technical.