Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Javascript Funcional - Uma breve introdução @Ig...
Search
hack.river
July 07, 2016
Programming
46
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Javascript Funcional - Uma breve introdução @Igor Soares
hack.river
July 07, 2016
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
47
Other Decks in Programming
See All in Programming
AWSに止められる覚悟してますか?
morizo_1984
2
530
なぜCTOを降りてFDEを選んだのか?〜なぜプロダクト企業がFDEで顧客の現場に踏み込むのか〜
gonta
1
210
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
270
AIに “答え“を書かせるのを やめてみた
___akari11
0
120
Workers Cache を知る
syumai
0
360
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
28
32k
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.9k
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
140
ジョジョの世界をXRで再現する
mofurune
0
160
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
8
2.2k
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
APNsからLive Activityを開始する話
yumnumm
0
170
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
A designer walks into a library…
pauljervisheath
211
25k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
320
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
270
How to Think Like a Performance Engineer
csswizardry
28
2.9k
Building Adaptive Systems
keathley
44
3.2k
A Soul's Torment
seathinner
8
3.8k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
550
Documentation Writing (for coders)
carmenintech
77
5.6k
Done Done
chrislema
187
17k
HDC tutorial
michielstock
2
960
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!