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

写出代码执行结果 #26

Open
MaMaFish opened this issue Jun 22, 2020 · 0 comments
Open

写出代码执行结果 #26

MaMaFish opened this issue Jun 22, 2020 · 0 comments

Comments

@MaMaFish
Copy link
Owner

MaMaFish commented Jun 22, 2020

var a = 0;
var b = 0;
function A(a) {
    A = function(b) {
        console.log(a + b++);
    }
    console.log(a++);
}
A(1)     ==>1
A(2)    ==>4

考察了闭包、函数重写、++、作用域

@MaMaFish MaMaFish changed the title 第26题:写出代码执行结果 写出代码执行结果 Jan 15, 2021
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