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
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
140
Escalando globalmente com TypeScript e JavaScript na Klarna
khaosdoctor
0
230
The future of JavaScript
khaosdoctor
0
100
TypeScript tips that could save your life
khaosdoctor
0
270
É hora de falar sobre Deno
khaosdoctor
0
100
JS Software testing for beginners
khaosdoctor
0
110
Ambientes dinâmicos com GitHub Actions
khaosdoctor
0
77
The Dark Side of JavaScript
khaosdoctor
0
110
Integrating Containers Into JavaScript
khaosdoctor
0
99
Other Decks in Programming
See All in Programming
パスワード再設定メールのURLについて知っておこう
uyuki234
0
180
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.7k
Domain-Driven Transformation
hschwentner
2
2.3k
Seven New Principles of Software Engineering
yegor256
0
280
golang-bob.pdf
iwatsukayura
0
140
TanStack Vue Query と Pinia Colada から学ぶ非同期状態の型設計
aoshi
0
170
気持ちぃ〜角丸 Squircle
ryu1013
0
340
ジョジョの世界をXRで再現する
mofurune
0
190
Optunaを作ったときにやりたかったこと、その後 (2026/10/16, Optuna Meetup #3)
iwiwi
3
1.2k
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
3
2k
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
240
R8 の設定見直しでアプリサイズ削減
andpad
0
230
Featured
See All Featured
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
Why Our Code Smells
bkeepers
PRO
340
58k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
490
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
300
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
Google's AI Overviews - The New Search
badams
0
1.6k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.9k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
940
ラッコキーワード サービス紹介資料
rakko
4
5.5M
Joys of Absence: A Defence of Solitary Play
codingconduct
1
550
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
280
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
1k
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