Skip to content

箭头函数与普通函数的区别 #6

@Chersquwn

Description

@Chersquwn
  • 箭头函数不会创建自己的this
  • 箭头函数的this继承自作用域链上一层的this
  • 箭头函数继承而来的this指向永远不变
  • callapplybind无法改变箭头函数中this的指向
  • 箭头函数没有原型prototype
  • 箭头函数不能作为构造函数使用
  • 箭头函数没有自己的arguments
  • 箭头函数不能用作Generator函数,不能使用yeild关键字

MDN上的箭头函数解释

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions