We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
第112天 函数声明与函数表达式有什么区别?
The text was updated successfully, but these errors were encountered:
函数声明会函数提升,将函数声明提升到作用域最上层,而函数表达式必须赋值完成了才能调用。
Sorry, something went wrong.
function fn() { ///... }
const aa = function() { ///... }
区别: 1.函数声明,函数名必须有,在函数表达式中可以省略函数名 2.函数声明会被预解析,函数表达式不会
最大的区别就是函数声明会提升至作用域的顶端,函数表达式则会在赋值之后能调用。
函数声明: 作用域会提升 function fn() {} 函数表达式:只有代码执行到该处后,函数才能被调用 var fn = function() {}
No branches or pull requests
第112天 函数声明与函数表达式有什么区别?
The text was updated successfully, but these errors were encountered: