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

你好,对前端开发面试题中有几处疑问 #87

Open
wly2014 opened this issue Apr 1, 2017 · 1 comment
Open

你好,对前端开发面试题中有几处疑问 #87

wly2014 opened this issue Apr 1, 2017 · 1 comment

Comments

@wly2014
Copy link

wly2014 commented Apr 1, 2017

  1. 说几条写JavaScript的基本规范?中的第9条:for-in循环中的变量 应该使用var关键字明确限定作用域,从而避免作用域污染。是不是应该使用let关键字?let才能实现for这种块级作用域不是?
  2. Javascript作用链域?中:当需要从局部函数查找某一*属性*或方法时,如果当前作用域没有找到,其中的属性是不是改成变量更好些?属性不是按原型链去查找的吗?
    望指教^_^
@jonirrings
Copy link

  1. 我觉得针对es5,是写个var之后避免造成全局/上级污染。当然es6中推荐let/const咯
  2. 👍赞同

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