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
所以我感觉实际上sayHi函数已经被提升了,并且新的词法环境使得两个变量都是能够访问到的
The text was updated successfully, but these errors were encountered:
贴个链接
Sorry, something went wrong.
+1,我这边试了也是正常
@shylock-wu @7ASSEL Hello,这个实际是因为 devtool 默认在非严格模式下,详见 https://zh.javascript.info/strict-mode
另外,在现代前端开发工具链下,预置开发环境和构建工具基本都会默认开启严格模式。除非显式的通过 @babel/plugin-transform-strict-mode 或者一些配置来放开限制(不建议),非严格模式主要为了向前兼容 ES5 之前的一些表现。
No branches or pull requests
位置
网站实际运行效果
浏览器控制台运行效果
结论
所以我感觉实际上sayHi函数已经被提升了,并且新的词法环境使得两个变量都是能够访问到的
The text was updated successfully, but these errors were encountered: