Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

closure.md 文章 #53

Open
ten-ltw opened this issue Apr 15, 2021 · 0 comments
Open

closure.md 文章 #53

ten-ltw opened this issue Apr 15, 2021 · 0 comments

Comments

@ten-ltw
Copy link

ten-ltw commented Apr 15, 2021

案例1-基本介绍

function A(){
    var localVal=10;
    return localVal;
}

A();//输出30


function A(){
    var localVal=10;
    return function(){
         console.log(localVal);
         return localVal;
    }
}
var func=A();
func();//输出10

上面的注释应该是输出 10。
还有闭包这篇首页无法导航,没具体看什么原因。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant