logo
  • 教程列表
  • SO官方文档
  • 带有 Node.js 的 ECMAScript 2015(ES6)
    • constlet 声明
    • 箭头函数
    • 箭头函数示例
    • 解构
    • 流
    • ES6 课程
  1. StackOverflow 文档
  2. Node.js 教程
  3. 带有 Node.js 的 ECMAScript 2015(ES6)
  4. 箭头函数

箭头函数

Created: November-22, 2018

箭头函数自动绑定到周围代码的 this 词法范围。

performSomething(result => {
  this.someVariable = result
})

VS

performSomething(function(result) {
  this.someVariable = result
}.bind(this))
  • 箭头函数示例
  • constlet 声明

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明