Below is a loop for two functions:
const foos = [1, 2, 3, 4, 5];
for ( let foo of foos ) {
func1(foo);
func2(foo);
}
I want to split it in two. Because of the semantic separation of the code.
const foos = [1, 2, 3, 4, 5];
for ( let foo of foos ) {
func1(foo);
}
for ( let foo of foos ) {
func2(foo);
}
Leaving aside why I should do this, I am wondering if performance is degraded. In both cases, it's okay because it's O (n), right?