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

2.1.2 函数声明提升 代码示例错误反馈 #7

Closed
xiaolong0114 opened this issue Sep 7, 2020 · 1 comment
Closed

2.1.2 函数声明提升 代码示例错误反馈 #7

xiaolong0114 opened this issue Sep 7, 2020 · 1 comment

Comments

@xiaolong0114
Copy link

2.1.2 函数声明提升 中的代码

虽然此章节为重点讲解函数声明的提升,但是因为log了func1,所以此处建议进行修改

//函数的声明形态
function func0() {
return 0;
}
console.log(func0); //>> func0() {return 0}
console.log(func1); //>> undefined
//函数的表达式形态
var func1 = function() {
return 1;
};

应该为

//变量声明提升
var func1
//函数的声明形态
function func0() {
return 0;
}
console.log(func0); //>> func0() {return 0}
console.log(func1); //>> undefined
//函数的表达式形态
func1 = function() {
return 1;
};

@xiaolong0114 xiaolong0114 changed the title 代码错误反馈 2.1.2 函数声明提升 代码示例错误反馈 Sep 7, 2020
@coffe1891
Copy link
Owner

感谢提醒,已修正。

ps:你也可以fork一份本书,然后提交pull request,这样就更方便review代码进行交流了。

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

2 participants