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
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
260
É 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
89
Other Decks in Programming
See All in Programming
Webの地図
yosuke_furukawa
PRO
4
3.8k
Foundry Localでエージェント開発
seosoft
0
160
Hono + Inertia + React で LP を構築した話
oukayuka
2
220
[GoCon2026] When Goroutines Are Not Enough: Runtime Locality in High-Throughput Go
takehaya
6
1.6k
MIZARU@SPAJAM2026 第二回予選
1901drama
0
110
XP祭りでしか伝わらないフリップネタ #xpjug
murabayashi
0
120
市販E-Readerを乗っ取れ 〜Embedded Swiftで電子ペーパーガジェットを制御する〜
trickart
0
150
thread_parallel_with_free-threaded_Python_and_NumPy.pdf
riku_sakamoto
0
250
デプロイ直後のレイテンシスパイクを調べたら、 Railsの仕様にたどり着いた
nhsykym
0
110
変化を抱擁するドキュメントの作り方 - ビジネスルール駆動開発がもたらす、コードとの新しい関係
ioki
2
130
世界の中心で、AI(App Intents)をさけぶ ー App Intents中心設計の実践ガイド
touyou
0
280
アクセシビリティから考える情報設計
high_g_engineer
0
350
Featured
See All Featured
Believing is Seeing
oripsolob
1
210
Joys of Absence: A Defence of Solitary Play
codingconduct
1
500
Building an army of robots
kneath
306
46k
The Cost Of JavaScript in 2023
addyosmani
55
10k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
400
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
300
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
880
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
330
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.1k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
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