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
Desmistificando Herança e Protótipos no JS - Short
Search
Lucas Santos
June 04, 2020
Programming
190
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Desmistificando Herança e Protótipos no JS - Short
Lucas Santos
June 04, 2020
More Decks by Lucas Santos
See All by Lucas Santos
The Hitchhiker's Guide for an Amazing API with TypeScript
khaosdoctor
0
130
Escalando globalmente com TypeScript e JavaScript na Klarna
khaosdoctor
0
220
The future of JavaScript
khaosdoctor
0
96
TypeScript tips that could save your life
khaosdoctor
0
250
É hora de falar sobre Deno
khaosdoctor
0
96
JS Software testing for beginners
khaosdoctor
0
110
Ambientes dinâmicos com GitHub Actions
khaosdoctor
0
71
The Dark Side of JavaScript
khaosdoctor
0
99
Integrating Containers Into JavaScript
khaosdoctor
0
88
Other Decks in Programming
See All in Programming
まずはプロンプトガイドを読もう、話はそれからだ
kiakiraki
1
260
Kiroで創り、AgentCoreで繋ぐ!AWSで実践する「AI-DLC」から「AIエージェント統合」までの最新地図
licux
2
310
MySQLとPostgreSQLって何が違うの?
akagami
PRO
0
160
in-process GraphQL のすすめ #ginzajs
izumin5210
4
1.5k
承認済みなのに差戻しできてしまうバグ、型で潰せます
shinchit
0
140
私のClaude Code活用法 (個人開発編) - PHPerKaigi mini #4(2026/08/24)
panda_program
1
210
LL言語やWebフレームワークのPostgreSQL対応 〜DBの機能がユーザーに届くまで〜
kentaroutakeda
0
140
Press start. Python's next generation.
willingc
PRO
3
300
AWS DevOps Agentで インシデント対応をAIに任せたい
honmarkhunt
5
1.5k
一参加者から『中の人』へ 〜全通PHPerがブースに立って学んだ、カンファレンスを100倍楽しむコツ〜
wp_daisuke
0
110
初めての模倣学習とVLA
natsutan
0
470
リアルな遅延を測る仕様
kota_yata
1
140
Featured
See All Featured
Practical Orchestrator
shlominoach
191
12k
Designing for Timeless Needs
cassininazir
1
470
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.1k
Making Projects Easy
brettharned
120
6.7k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
520
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
230
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
510
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
690
Navigating Team Friction
lara
192
16k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
2.7k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Designing Experiences People Love
moore
143
24k
Transcript
Desmistificando Herança e Prototypes no Javascript Sempre esteve lá, ninguém
sabia o porquê
$ whoami Lucas Santos /khaosdoctor @_staticvoid lsantos.me Cloud Advocate
[email protected]
@khaosdoctor
trainingcenter.io 2018.abcdevelopers.org
O.O.P
Encapsulamento
None
None
Polimorfismo
None
Arrow functions não vão funcionar
????????
Herança
Herança nos dá isso
Herança nos dá isso De onde veio isso?
De onde as coisas vem?
Tipos originais De onde tudo aparece
Array()
Function()
Object()
String Number Object Array Func RegExp
None
Como elas funcionam?
None
__proto__
Nunca toque no __proto__
Object.Prototype Não. Não é a mesma coisa
Prototype é um objeto de propriedades
O famoso “new”
Instâncias
Instâncias
Instâncias
Instâncias
Instâncias
Herança! Mas não é qualquer herança...
Herança Prototípica
Herança Prototípica
Instâncias
Cadeias de protótipos Como eu sei o que eu quero?
Cadeias de protótipos
Cadeias de protótipos
Cadeias de protótipos
Cadeia de protótipos
Cadeia de protótipos
Cadeias de protótipos: a prática
O fim da cadeia
O fim da cadeia?
E o “extends”?
Extends
Extends
Extends: Exemplo
Extends
O que eu faço com isso?
1. Métodos globais
2. Overload
2. Overload - Os problemas
None
3. Performance
3. Performance .print
3. Performance
3. Performance
Referências - bit.ly/medium-prototypes - bit.ly/ecma-proto - mzl.la/mdn-proto - mzl.la/function-js -
mzl.la/extends-jsx - bit.ly/encapsulamento-js - bit.ly/polimorfismo-js - bit.ly/this-js - bit.ly/imasters-smoosh
/khaosdoctor @_staticvoid lsantos.me @khaosdoctor