3 ms·
I may have discovered the worst correct answer: var foo = function (arr, i) { if (typeof arr === 'number') { arr = new Array(arr); f
by evunveot 12y ago
I may have discovered the worst correct answer:
var foo = function (arr, i) {
if (typeof arr === 'number') {
arr = new Array(arr);
foo(arr, arr.length - 1);
return arr;
}
if (i === -1) {
return;
}
arr[i] = function () {
return i;
}
foo(arr, i - 1);
};