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