I want to type something like [1] * totalPoints
so that if totalPoints was 3, it would give me an array of [1,1,1]. I can't think of what it would be called though.. as such, my searches have turned up nothing. I mean, I could easily accomplish this with a for loop, but I seem to be under the impression that I've used something like this before and I just can't think of it.
Is there anything like this in javascript?
↧
How to instantiate a javascript array with the same value
↧