Asynchronity and Closures

Run Settings
LanguageJavaScript
Language Version
Run Command
function fooFunc(){ var bar = "something"; doSomething(function(msg){ bar += msg; }); console.log(bar); } function doSomething( callback ){ setTimeout(function(){ callback("append"); }, 1000 ); } fooFunc();
Editor Settings
Theme
Key bindings
Full width
Lines