js回调函数

this.test((res)=>{

  console.log(res);//接受的回调参数

})

test(callback){

  if(true){

    callback("Y");

  }else{

    callback("N")

  }

}

原文地址:https://www.cnblogs.com/fdxjava/p/12689561.html