MonLes
MonLes

嘗試從都市叢林回到魔法森林。 更多作品 | https://linktr.ee/monles

Javascript — 第 06天




你可在github找到 source code | Here



本日主題

  • 進階函式Advanced Function
  • -閉包closure
  • -currying
  • -compose
  • 進階陣列Advanced Arrays
  • -forEach
  • -mapArray
  • -filter
  • 進階物件Advanced Objects
  • -reference type
  • -context
  • -instantiation


閉包Closure

  • 一個函式執行
  • 不會再跑一遍
  • child scope會記得reference,可進入 parent scope
  • 但parent scope 無法進入child scope



Currying



Compose




Advanced Arrays
forEach & mapArray 差異在於
mapArray總有回傳值(returned value)

forEach



mapArray




filter




reduce

超好用💪





進階物件advanced Object

reference type



context

就像是javascript環境

實例化instantiation

更多資訊 | MDN



CC BY-NC-ND 2.0 版权声明

喜欢我的文章吗?
别忘了给点支持与赞赏,让我知道创作的路上有你陪伴。

加载中…
加载中…

发布评论