function method1() {
method2();
var x = 1;
}
function method2() {
$.ajax({
type: "GET",
async: true,
url: "/MyController/MyMethod",
success: function (data) {
var y = 6;
}
});
}
Which happens first - the initialization of y or the initialization of x?
Which would be the order of these two lines if the ajax call was sync instead of async?
method1 is called in the loading of the page.