JavaScript challenge! Solution in my next video #webdevelopment #programming #vscode #css #html

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

I think it will be infinity loop with console.log(“Code is running”)
Because setTimeout will go to event loop and event loop will wait until execution stack will be empty to push setTimeout’s callback to stack. But stack would’t be empty because it will have while loop in it

andryush
Автор

Infinite "Code is running" text will be displayed, cause when stack is empty event loop will put setTimeout context on it, but stack is infinite, it never stops, that's the answer

jamshid_khamidovich
Автор

I had pretty much the same response as the other comments, the while loop will block the event loop before it gets to the stage where it goes through all
the timeouts, resulting in an infinite “code is running” log, but I almost didn’t post my response after seeing all the other ones and I’m just using this whole comment so I’m not just saying what the answer was like everyone else

amukh_dev
Автор

Java is single threaded, you make it stuck in while forever

zxopink
Автор

I think it will never stop "infinity Loop" thats due to the scope because the var is set to true in global scope

CarlosCosta_
Автор

I would never do this so the answer is irrelevant. Lol

Michael-Martell
visit shbcf.ru