3 ms·
As long as the ahead of time optimizations that dont have a large enough negative drawback in another criteria (speed vs size) are welcomed by me, even if the J
by yairhaimo 9y ago
As long as the ahead of time optimizations that dont have a large enough negative drawback in another criteria (speed vs size) are welcomed by me, even if the JIT can do the same optimizations too.
Regarding your code example, maybe prepack was changed in the past week and a half, but it is folded quite fine when i tried it:
(function() {
function foo() { const bar = 42; for (let i = 0; i <= bar; i++) { if (i === bar) { return bar; } } };
console.log(foo());
})();