Performance is slightly improved when declaring loop statement variables outside of loops rather than inside.
Example:
for (let i = 0; i < some_array.length; ++i) {
// ...
}
Versus:
let i = 0;
let length = some_array.length;
for (i; i < length; ++i) {
// ...
}
The second example is ever so slightly faster than the first one. All of Momo's loops should have their variables declared outside of the loops when appropriate to improve performance.
Performance is slightly improved when declaring loop statement variables outside of loops rather than inside.
Example:
Versus:
The second example is ever so slightly faster than the first one. All of Momo's loops should have their variables declared outside of the loops when appropriate to improve performance.