Still wrapping my head around Javascript's asynchronous nature. Help me understand this: I have several functions that need to be run on items in an array.
We have Option 1:
for (f of files){
do_a(f);
do_b(f);
do_c(f);
}
vs Option 2:
for (f of files){
do_a(f);
}
for (f of files){
do_b(f);
}
for (f of files){
do_c(f);
}
- Which would be faster?
- In option 1 would the do_b function fire even if do_a is still working?
- In option 2 would the do_b loop fire even if do_a loop is still working?
do_ais asynchronous. 3. yes, ifdo_ais asynchronous.