-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
异步和直接调用对应
而异步一般和回调的套路一块出现的(不然拿不到结果)
function fn(another){
setTimeout(
another(参数)
,10000)
}
fn() 直接调用
function another(参数){
console.log('参数')
}
fn(another) //异步,派一个函数过去,让别人执行这个函数(里面有一个回调的套路)
阮一峰(四种异步模式):
http://www.ruanyifeng.com/blog/2012/12/asynchronous%EF%BC%BFjavascript.html