先行の処理を待たないというのは
どういう事なのでしょうか?
以下環境、コードで試してみたところ
前>おもい>後>中 という実行結果になりました。
ちゃんとomoi();を待っているような気がするのです。
どなたか教えて頂けませんでしょうか。。。
●環境
chrome 42.0.2311.135 m
windows7 ultimate SP1
●コード
<html lang="ja"> <head> <title>test</title> <meta charset="utf-8"> </head> <body> <script> function omoi() { //※4秒くらいの処理 var i = 1; var j = 1; while (i < 6000000000) { j += i; i++; } console.log("おもい") }</script> </body> </html>console.log("前"); omoi(); setTimeout(function() {console.log("中");}, 1000); console.log("後");
回答4件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。