Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

[JS EXPERIENCE 2018] Use JavaScript Funcional no seu dia-a-dia - William Bruno, Beleza na Web

61 views

Published on

Use JavaScript Funcional no seu dia-a-dia - William Bruno, Beleza na Web [JS EXPERIENCE 2018] - 5 de julho de 2018 São Paulo/SP

[JS EXPERIENCE 2018] - 5 de julho de 2018
São Paulo/SP

Published in: Technology
  • Be the first to comment

  • Be the first to like this

[JS EXPERIENCE 2018] Use JavaScript Funcional no seu dia-a-dia - William Bruno, Beleza na Web

  1. 1. Functional JavaScript
  2. 2. William Bruno Desenvolvedor NodeJS http://wbruno.com.br/ http://github.com/wbruno wbrunom@gmail.com @wbrunom
  3. 3. Forget it!
  4. 4. Functional Programming Dividir um problema em probleminhas menores https://blog.taller.net.br/programacao-funcional-parte1/
  5. 5. How smaller? Transparência
 Pureza Imutabilidade https://www.slideshare.net/webf/functional-programming-with-javascript
  6. 6. Why? Funções Puras
 Evitar side effects Evitar estados (dados imutáveis) Programar de forma declarativa
 Reduzir complexidade Composição Lazy Evaluation https://www.slideshare.net/webf/functional-programming-with-javascript
  7. 7. loops
  8. 8. .forEach() loop
  9. 9. .forEach() inject pure function
  10. 10. .map() creates a new array of same length
  11. 11. .map() creates a new array of same length
  12. 12. .map() creates a new array of same length
  13. 13. .map() creates a new array of same length
  14. 14. .filter() creates a new array with elements that passes
  15. 15. .find() finds the match
  16. 16. .reduce() applies a function against a accumulator, to reduce to a single value
  17. 17. .some() test if some element passes, returns boolean
  18. 18. .every() test if every element passes, returns boolean
  19. 19. .includes() @deprecated indexOf
  20. 20. .pop(), .push(), .shift(), .unshift() removes or add the last or first element of array
  21. 21. Lazy.js eval only when needed http://danieltao.com/lazy.js/
  22. 22. What else? Monad (maybe, just, etc)
 Pipes (composition)
 Currying https://medium.com/tableless/entendendo-programa%C3%A7%C3%A3o-funcional-em-javascript-de-uma-vez-c676489be08b
  23. 23. Obrigado

×