Answer the question
In order to leave comments, you need to log in
Why is the code running in parallel?
Hello.
Baby, a question.
There is a js code (pseudo):
while (elem.opacity > 0) {
elem.opacity -= .1;
}
elem.remove();
Answer the question
In order to leave comments, you need to log in
In your case, most likely, opacity changes in thousandths of a second and remove works .
Demo.
All execution steps in the console. On my work machine, opacity changes from 1 to 0 in 0.005 seconds. Imagine how little that is.
The code is synchronous. It cannot run in parallel.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question