Upgrade to Pro — share decks privately, control downloads, hide ads and more …

初探 functional programming

CypressKuo
February 03, 2017

初探 functional programming

CypressKuo

February 03, 2017
Tweet

More Decks by CypressKuo

Other Decks in Technology

Transcript

  1. 3

  2. 4

  3. 特色 ✣ Expression, no Statement ✣ First-class ✣ High order

    function ✣ No side effect ✣ Referential transparency ✣ Pure Function 5
  4. 8

  5. 9

  6. 10

  7. 12

  8. ✣ .map() ✣ .filter() ✣ .reduce() ✣ .forEach() ✣ .some()

    ✣ .every() 常見的 High order function 13
  9. Pure Function 結合 no side effect 與 Referential transparency 一個

    function 給予相同的參數, 永遠會回傳相同的返回值,並且沒有任何顯著的副作用 16
  10. 17

  11. 18

  12. 21

  13. 22

  14. 24

  15. 25