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
Using Jquery:
$.map($(Array(8)),function(val, i) { return i; })
This returns:
[0, 1, 2, 3, 4, 5, 6, 7]
$.map($(Array(8)),function() { return 1; })
[1, 1, 1, 1, 1, 1, 1, 1]