Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //方法 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() );
Add Comment
Please, Sign In to add comment