new array of items from 1 to n js code example Example 1: js array of 1 to n [...Array(10).keys()] Example 2: array for numbers array for numbers