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

2021/03/01 - 箭头函数和普通函数的区别 #61

Open
lxinr opened this issue Mar 1, 2021 · 0 comments
Open

2021/03/01 - 箭头函数和普通函数的区别 #61

lxinr opened this issue Mar 1, 2021 · 0 comments
Labels

Comments

@lxinr
Copy link
Owner

lxinr commented Mar 1, 2021

箭头函数表达式的语法比函数表达式更短,并且不绑定自己的this,arguments,super或 new.target。这些函数表达式最适合用于非方法函数(non-method functions),并且它们不能用作构造函数

  1. 箭头函数没有this,在箭头函数中访问的this实际来自于外部词法环境
  2. 箭头函数没有arguments
  3. 箭头函数不能使用new进行调用
  4. 箭头函数没有super
  5. 箭头函数没有原型
@lxinr lxinr added the JS基础 label Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant