The question that alert blocking threads causes the execution of functions in the event queue to be out of order

for(let i=0;i<5;iPP){
    setTimeout(() => {
      alert(i);
      // console.log(i);
    }, 0);
}

code, such as the above, has been tried in browsers such as chrome,safari, which will lead to confusion in the execution order of console.log code. A lot of explanations have been checked on the Internet, but the disorder can not be changed after testing. But there is nothing wrong with the same code in Firefox.
there are a few questions now:

  1. does alert blocking threads cause functions in the event queue to be out of order?
  2. how does the browser alert work?
Mar.22,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3bf4e-2b63a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3bf4e-2b63a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?