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
Reduzco, reuso y reciclo
Search
Lupo Montero
February 21, 2019
Programming
46
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Reduzco, reuso y reciclo
LimaJS - 21/02/2019
Lupo Montero
February 21, 2019
More Decks by Lupo Montero
See All by Lupo Montero
Trigonometría Bella
lupomontero
0
48
Analizadores sintácticos funcionales en JavaScript
lupomontero
0
110
Manejo de memoria en Rust: Ownership
lupomontero
0
49
Hola Rust! Aprendiendo con rustlings
lupomontero
1
350
WebThing: construyamos una lámpara 💡
lupomontero
1
100
Combinando y grabando ⏺ video 🎥 y audio 🎙 en el navegador
lupomontero
0
40
Web Assembly, Rust y el futuro de JavaScript
lupomontero
0
66
Primeros pasos con Rust y WebAssembly
lupomontero
0
560
Paralelizando promesas
lupomontero
0
370
Other Decks in Programming
See All in Programming
MIZARU@SPAJAM2026 第二回予選
1901drama
0
110
Seeing Through Serverless: Observability for AWS Lambda with ADOT and CloudWatch Application Signals
seike460
PRO
1
130
【高い買い物LT会】初任給で話題の国産フィジカルAIを買った話
akagami
PRO
0
130
iOS開発×AI駆動開発 〜最近使って便利だったスキルの話〜
nogu66
0
140
AIとGame Jamで、ゲームを完成させた話
takahirosaeki
0
120
LL言語やWebフレームワークのPostgreSQL対応 〜DBの機能がユーザーに届くまで〜
kentaroutakeda
0
150
XP祭りでしか伝わらないフリップネタ #xpjug
murabayashi
0
120
個人開発基盤をまるごとCloudflareに引っ越して爆速で総合的体験を向上させた話
tinykitten
0
140
Press start. Python's next generation.
willingc
PRO
3
330
Family mrubyの進捗
kishima
1
110
AI時代に学ぶ 好きなルール 嫌いなルール Linter編
shorty5121
0
910
AI × TiDD / 2026.09.05 Redmine 大阪
tokudiro
1
120
Featured
See All Featured
Design in an AI World
tapps
1
310
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
310
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
240
The Language of Interfaces
destraynor
162
27k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Thoughts on Productivity
jonyablonski
76
5.4k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
410
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
210
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
820
Producing Creativity
orderedlist
PRO
348
41k
A Soul's Torment
seathinner
7
3.6k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
890
Transcript
@lupomontero LimaJS - 21/02/2019
@Laboratoriala @LimaJSorg @NodeSchool @lupomontero @mozillaperu
Qué es reduce? Blah blah blah… • Transformar un arreglo
en un “valor” • Transformar un arreglo en otro “tipo” • Responder preguntas sobre la colección (por ejemplo estadísticas) • Resumir una colección • ...
[any] Array.prototype.reduce(fn, initialValue) The reduce() method executes a reducer function
(that you provide) on each member of the array resulting in a single output value. Fuente: MDN
.reduce .filter .map .forEach
None
[1,2,3,4,5].reduce((prev, item) => prev + item, 0)
Un ejemplo de reduce
Implementación imperativa • Bucle / iteración • Mutación / reasignación
Reglas del juego... • No sentencias / sólo expresiones •
No mutación / no re-asignación • ...
… antes de empezar con la implementación ... • Operador
ternario • Operador de propagación (spread operator) • !! (bang bang! doble negación)
Implementación declarativa • Recursión • Inmutabilidad • Expresiones
Ejemplos de aplicaciones de reduce • map • filter •
join • forEach • ...
map
filter
join
forEach
includes
indexOf
lastIndexOf
reverse
reduceRight
Fin (Gracias!)