Last active
August 29, 2015 13:57
-
-
Save gutenye/9757635 to your computer and use it in GitHub Desktop.
javascript basic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = function() { | |
console.log(1) | |
} | |
a() // run it | |
console.log(2) | |
// 同步的 结果是 | |
// 1 | |
// 2 | |
//================== | |
c = function(callback) { | |
// do something here | |
callback.call() // 因为你这个callback函数可以在任何时候执行, 或者根本不执行. | |
} | |
c(a) // 参数里面有函数的 就异步了 | |
console.log(2) | |
// 异步的 结果不确定 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment