I can't understand In which order will the functions foo and bar be executed?
1- foo and bar will execute in the same time, 2- We don't know 3-foo then bar 4- bar then foo, I think 1- but I don't sure
var res = {};
function foo(results) {
res.foo = results;
}
function bar(results) {
res.bar = results;
}
// ajax (..) is some arbitrary function given by a library
ajax( "http://some.url.1", foo );
ajax( "http://some.url.2", bar );