JSlint does not like the use of Array constructors, and there are no JSLint variants for them. Therefore, to create an array of length n, the following is not allowed:
var arr = new Array(n);
Is this the only way I can get around this?
var arr = []; arr.length = 5;
Under normal circumstances, this does not really matter (using two lines of code instead of one), but I'm sorry that I cannot use multiple line compression:
function repeat(str, times) { return new Array(times + 1).join(str); }
Ates goral
source share