-
-
Save mraiguo/ab4e592c5fa7cdee87f9ea716b8f618f to your computer and use it in GitHub Desktop.
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
function fun(n,o) { | |
console.log(o) | |
return { | |
fun:function(m){ | |
return fun(m,n); | |
} | |
}; | |
} | |
var a = fun(0); a.fun(1); a.fun(2); a.fun(3);//undefined,?,?,? | |
var b = fun(0).fun(1).fun(2).fun(3);//undefined,?,?,? | |
var c = fun(0).fun(1); c.fun(2); c.fun(3);//undefined,?,?,? | |
//问:三行a,b,c的输出分别是什么? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment