the
code is a multi-layer callback. The example code is as follows
var arr=[];
let A = ()=>{
//
B(function(){
C(function(){
let a = 10;
arr.push(a);
})
})
return arr
}
expect the arr in function c as the return value of function A, but because of asynchronism, the return statement will be executed first and undefined
will be returned. let data = A();
Please do not hesitate to comment