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
99
TypeScript tips that could save your life
khaosdoctor
0
260
É hora de falar sobre Deno
khaosdoctor
0
99
JS Software testing for beginners
khaosdoctor
0
110
Ambientes dinâmicos com GitHub Actions
khaosdoctor
0
76
The Dark Side of JavaScript
khaosdoctor
0
110
Integrating Containers Into JavaScript
khaosdoctor
0
97
Other Decks in Programming
See All in Programming
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
110
20260914 AIエージェント時代のPlatform Engineering LLM基盤とプロダクトの責務境界線
kanfab1
7
2.3k
手動確認はもう限界 〜XCUITestでCustom URL Schemeの遷移を起動種別ごとに自動テストする〜 / Testing Custom URL Schemes with XCUITest
otouto
0
370
WebRTC映像をAirPlayに対応させる挑戦.pdf
monolithic_adam
0
330
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
380
Go × SIMDで高速化するベクトル検索 ~ルーフラインモデルでSIMDが効く境界を探れ! ~
po3rin
1
5.7k
Agents on Rails - Rails at Scale 2026
irinanazarova
0
310
Java 27新機能 / Java 27 new features
kishida
2
190
Simple Storage Service(S3) is not simple
iwatsukayura
0
120
FreeBSDでZabbixを動かす
kenkino
0
340
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.7k
フロントエンドUIフレームワークのこれまでとこれから
ssssota
5
3.1k
Featured
See All Featured
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
550
Designing Powerful Visuals for Engaging Learning
tmiket
1
590
[RailsConf 2023] Rails as a piece of cake
palkan
59
7k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
Producing Creativity
orderedlist
PRO
348
41k
How to make the Groovebox
asonas
2
2.5k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
960
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
510
The untapped power of vector embeddings
frankvandijk
2
1.9k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.2k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
930
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.9k
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