Is there a way to generate sequence of characters or numbers in javascript?
For example, I want to create array that contains eight 1s. I can do it with for loop, bu
One liner:
new Array(10).fill(1).map( (_, i) => i+1 )
Yields:
[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]