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
180
1
Share
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
120
Escalando globalmente com TypeScript e JavaScript na Klarna
khaosdoctor
0
210
The future of JavaScript
khaosdoctor
0
88
TypeScript tips that could save your life
khaosdoctor
0
240
É hora de falar sobre Deno
khaosdoctor
0
89
JS Software testing for beginners
khaosdoctor
0
99
Ambientes dinâmicos com GitHub Actions
khaosdoctor
0
57
The Dark Side of JavaScript
khaosdoctor
0
92
Integrating Containers Into JavaScript
khaosdoctor
0
85
Other Decks in Programming
See All in Programming
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
5
790
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
4
1.4k
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3k
RTSPクライアントを自作してみた話
simotin13
0
380
次世代リンターで探る、tsgo 時代における型認識カスタムルールの現実解
ytakahashii
3
1.3k
iOS26時代の新規アプリ開発
yuukiw00w
0
220
TSKaigi 2026 TypeScriptバックエンドのオブザーバビリティ戦略 — Datadog × NestJSの実践
taiseiyamamotoan
1
210
「エンジニアインターン、どうやって取った?」準備のリアルを語るLT会 Progate BAR
akiomatic
0
100
Stage 3 Decorators でできること / できないこと / TSKaigi 2026
susisu
1
1.4k
RailsTokyo 2026#4: AI様があれば、 Hotwireの弱点は消えるか?
naofumi
5
1k
[KCD Czech] eBPF Meets the GPU: Future of AI Infra Observability
doniacld
0
130
メソッドのジェネリクスでGoの夢は広がるか? / Kyoto.go #65
utgwkk
0
110
Featured
See All Featured
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.3k
Odyssey Design
rkendrick25
PRO
2
650
Skip the Path - Find Your Career Trail
mkilby
1
130
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
55k
A better future with KSS
kneath
240
18k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.9k
Leo the Paperboy
mayatellez
7
1.8k
30 Presentation Tips
portentint
PRO
1
310
Raft: Consensus for Rubyists
vanstee
141
7.5k
HDC tutorial
michielstock
2
680
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