en.javascript.info/1-js/7-js-misc/3-setTimeout-setInterval/4-settimeout-result/solution.md
2015-01-14 10:23:45 +03:00

8 lines
No EOL
550 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Ответы:
<ul>
<li>`alert` выведет `100000000`.</li>
<li>**3**, срабатывание будет после окончания работы `hardWork`.</li>
</ul>
Так будет потому, что вызов планируется на `100мс` от времени вызова `setTimeout`, но функция выполняется больше, чем `100мс`, поэтому к моменту ее окончания время уже подошло и отложенный вызов выполняется тут же.