Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Javascript Funcional - Uma breve introdução @Ig...
Search
hack.river
July 07, 2016
Programming
0
42
Javascript Funcional - Uma breve introdução @Igor Soares
hack.river
July 07, 2016
Tweet
Share
More Decks by hack.river
See All by hack.river
hack.river #intro
hackriver
0
720
ElasticSearch - Tornando suas buscas textuais mais poderosas @Thiago Gonzaga
hackriver
0
40
Other Decks in Programming
See All in Programming
16年目のピクシブ百科事典を支える最新の技術基盤 / The Modern Tech Stack Powering Pixiv Encyclopedia in its 16th Year
ahuglajbclajep
5
1k
コントリビューターによるDenoのすゝめ / Deno Recommendations by a Contributor
petamoriken
0
200
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
130
そのAIレビュー、レビューしてますか? / Are you reviewing those AI reviews?
rkaga
6
4.6k
AIによるイベントストーミング図からのコード生成 / AI-powered code generation from Event Storming diagrams
nrslib
2
1.9k
Grafana:建立系統全知視角的捷徑
blueswen
0
330
AIエージェントのキホンから学ぶ「エージェンティックコーディング」実践入門
masahiro_nishimi
5
450
MUSUBIXとは
nahisaho
0
130
QAフローを最適化し、品質水準を満たしながらリリースまでの期間を最短化する #RSGT2026
shibayu36
2
4.4k
Fragmented Architectures
denyspoltorak
0
150
Apache Iceberg V3 and migration to V3
tomtanaka
0
160
AI & Enginnering
codelynx
0
110
Featured
See All Featured
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.3k
Tell your own story through comics
letsgokoyo
1
810
A better future with KSS
kneath
240
18k
Heart Work Chapter 1 - Part 1
lfama
PRO
5
35k
Deep Space Network (abreviated)
tonyrice
0
48
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
53
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
65
Building an army of robots
kneath
306
46k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
300
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
120
The Cult of Friendly URLs
andyhume
79
6.8k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
310
Transcript
Javascript Funcional uma breve Introdução
github.com/ripfoghorn twitter.com/ripfoghorn_ 20 anos desenvolvedor back-end por 3 anos entusiasta
de robôs gigantes
Programação Funcional?
Paradigma de programação que trata a computação como uma avaliação
de funções matemáticas e que evita estados ou dados mutáveis.
?
Paradigma
Funções puras Imutabilidade de estado Composição de funções Redução de
código
Matemática
f(x) = 2x + 1
f(3) = 2(3) + 1 = 7
g(y) = y + 5
f(g(y)) = f(y + 5) = 2(y + 5) +
1 = 2y + 11
Programação Funcional == Matemática
Funções
function f(x) { return 2*x + 1; }
function g(y) { return y + 5; }
console.log(f(g(3)));
17
Funções de ordem superior e funções de primeira classe
var composta = function(a) { return f(g(a)); }
composta(3) //=> 17 composta(4) //=> 19
Composição
var add1= function(x){ return x + 1; }
var quadrado = function(x){ return x * x; }
var f = function(x) { return add1(quadrado(x)); }
console.log(f(7)) ??
50
Funções Puras Imutabilidade de estado
function pura(a, b) { return a + b; }
var a = 1; function impura(b) { return a +
b; }
a = new Date().getDay();
Estado
f(x) = 2x f(2) = 4
Arrays!
Curry!
OK, mas por que Javascript mesmo?
Node NPM Full-stack
ES6 Arrow Functions Map Reduce Filter ...
IIFE’s
(function() {...})(); (()=> {...})();
Underscore Lodash Ramda Immutable Fn Function
Fun();
Obrigado!