Created
May 21, 2018 12:26
-
-
Save zhangkn/49f0ea0f2615f4475e10fe9f00f47c8f to your computer and use it in GitHub Desktop.
This file contains 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
//方法 1 | |
function a (x) { | |
return x; | |
} | |
//方法 2 | |
var b = function (x) { | |
return x; | |
} | |
//function 同时也支持以下的语法(匿名函数,闭包等): | |
var a = function (x) { | |
return function () { return x;} | |
} | |
var b = a(100); | |
console.log( 100 === b() ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment