标签云

微信群

扫码加入我们

WeChat QR Code

Had a debate with my colleague on this, as we had to deal with some async/sync issues. However, it raised another question, which I couldn't figure out a definite answer for.Assume a simple for-each loop ($.each), where for-each iteration I call a function set in the global scope. Does the function run synchronously or asynchronously? Assume no Ajax, so what the function does is completely synchronous, albeit merely executed. In other words, I wonder whether the function call itself is blocking within the iteration or not.Thanks!


Isn't JavaScript still single-threaded?

2019年04月22日03分49秒

so which side of this bet...[cough ..cough] .. debate were you on...payee..or payer?

2019年04月23日03分49秒

Payee of course. ;)

2019年04月22日03分49秒

So you guys are saying the iteration will not continue until the function called is done running, correct?

2019年04月23日03分49秒

asde that's right

2019年04月22日03分49秒