var a = 1;
debugger
$.ajax ({
url:"",
type:"",
data:"",
success: function(data = "22"){
a = data
}
})
debugger / / the breakpoint here we can clearly see that the request has been sent and the data in success is
console.log (a)
with a return value, but the question is, don"t you wait for the Synchronize function to execute async? Shouldn"t there be a breakpoint not to leave ajax at this time? For example, the following
var a = 1;
debugger
setTimeout (() = > {aquired 33"}, 0)
debugger / / Last executed setTimeout
console.log (a)