4 ms·
No doubt about it. The question was about avoiding the if/else within the for loop body. In js the for could be replaced with an array of 100 elems and a forEa
by ggurgone 11y ago
No doubt about it. The question was about avoiding the if/else within the for loop body.
In js the for could be replaced with an array of 100 elems and a forEach:
Array.apply(null, { length: 100 }).forEach(function (_, i) { })