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
1
160
Desmistificando Herança e Protótipos no JS - Short
Lucas Santos
June 04, 2020
Tweet
Share
More Decks by Lucas Santos
See All by Lucas Santos
The Hitchhiker's Guide for an Amazing API with TypeScript
khaosdoctor
0
86
Escalando globalmente com TypeScript e JavaScript na Klarna
khaosdoctor
0
190
The future of JavaScript
khaosdoctor
0
56
TypeScript tips that could save your life
khaosdoctor
0
180
É hora de falar sobre Deno
khaosdoctor
0
72
JS Software testing for beginners
khaosdoctor
0
73
Ambientes dinâmicos com GitHub Actions
khaosdoctor
0
39
The Dark Side of JavaScript
khaosdoctor
0
71
Integrating Containers Into JavaScript
khaosdoctor
0
63
Other Decks in Programming
See All in Programming
プロダクト志向なエンジニアがもう一歩先の価値を目指すために意識したこと
nealle
0
120
設計やレビューに悩んでいるPHPerに贈る、クリーンなオブジェクト設計の指針たち
panda_program
6
1.8k
NPOでのDevinの活用
codeforeveryone
0
680
来たるべき 8.0 に備えて React 19 新機能と React Router 固有機能の取捨選択とすり合わせを考える
oukayuka
2
880
Discover Metal 4
rei315
2
110
Go1.25からのGOMAXPROCS
kuro_kurorrr
1
850
Flutterで備える!Accessibility Nutrition Labels完全ガイド
yuukiw00w
0
140
Is Xcode slowly dying out in 2025?
uetyo
1
240
Kotlin エンジニアへ送る:Swift 案件に参加させられる日に備えて~似てるけど色々違う Swift の仕様 / from Kotlin to Swift
lovee
1
260
Railsアプリケーションと パフォーマンスチューニング ー 秒間5万リクエストの モバイルオーダーシステムを支える事例 ー Rubyセミナー 大阪
falcon8823
4
1k
Team topologies and the microservice architecture: a synergistic relationship
cer
PRO
0
1.2k
Blazing Fast UI Development with Compose Hot Reload (droidcon New York 2025)
zsmb
1
280
Featured
See All Featured
RailsConf 2023
tenderlove
30
1.1k
YesSQL, Process and Tooling at Scale
rocio
173
14k
The Cost Of JavaScript in 2023
addyosmani
51
8.5k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
107
19k
Thoughts on Productivity
jonyablonski
69
4.7k
The Language of Interfaces
destraynor
158
25k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.5k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
130
19k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
The Pragmatic Product Professional
lauravandoore
35
6.7k
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