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

  • 關於本站
  • 免責聲明