Skip to content

Instantly share code, notes, and snippets.

@hakobe
Created October 9, 2008 07:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hakobe/15721 to your computer and use it in GitHub Desktop.
Save hakobe/15721 to your computer and use it in GitHub Desktop.
function f(n) {
setTimeout(function () { alert(n + ' in f') }, 0);
return n;
}
function g() {
alert(f('1'));
alert('2');
alert('3');
}
alert('0')
g(); // 1, 2 ,3
alert('4');
alert(f('5'));
alert('6');
// ここではじめて実行キューにたまってるイベントを処理する
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment