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
The 'New' Keyword in JavaScript
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Chris Bateman
April 16, 2014
Programming
0
66
The 'New' Keyword in JavaScript
Chris Bateman
April 16, 2014
Tweet
Share
More Decks by Chris Bateman
See All by Chris Bateman
Web Audio API + AngularJS
chrisbateman
1
830
Other Decks in Programming
See All in Programming
組織で育むオブザーバビリティ
ryota_hnk
0
170
Architectural Extensions
denyspoltorak
0
280
フルサイクルエンジニアリングをAI Agentで全自動化したい 〜構想と現在地〜
kamina_zzz
0
400
コマンドとリード間の連携に対する脅威分析フレームワーク
pandayumi
1
450
AgentCoreとHuman in the Loop
har1101
5
230
Oxlint JS plugins
kazupon
1
890
izumin5210のプロポーザルのネタ探し #tskaigi_msup
izumin5210
1
110
AIによるイベントストーミング図からのコード生成 / AI-powered code generation from Event Storming diagrams
nrslib
2
1.9k
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
690
AI Agent の開発と運用を支える Durable Execution #AgentsInProd
izumin5210
7
2.3k
Rust 製のコードエディタ “Zed” を使ってみた
nearme_tech
PRO
0
170
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
180
Featured
See All Featured
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.2k
The Invisible Side of Design
smashingmag
302
51k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
220
My Coaching Mixtape
mlcsv
0
47
Six Lessons from altMBA
skipperchong
29
4.1k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
53
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
76
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.4k
Skip the Path - Find Your Career Trail
mkilby
0
54
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
1.9k
How to Talk to Developers About Accessibility
jct
2
130
Transcript
None
None
None
None
var simpleObject = { a: 'a' }; { a: 'a'
} simpleObject.toString(); // um, where does this function come from?
None
var simpleObject = { a: 'a' }; { a: 'a',
__proto__: { ... toString: function, hasOwnProperty: function, ... } }
var Demo = function() { ... }; Demo.prototype.doSomething = function()
{ ... };
var Demo = function() { this.prop = 'text'; }; Demo.prototype.action
= function() { alert(this.prop); }; var myDemo = Demo(); myDemo; // undefined myDemo.action() // ERROR window.prop; // 'text'
var Demo = function() { this.prop = 'text'; }; Demo.prototype.action
= function() { alert(this.prop); }; var myDemo = Demo(); myDemo; // { prop:'a', action:function } window.prop; // undefined myDemo.action(); // alerts "text"
var Demo = function() { this.prop = 'text'; }; Demo.prototype.action
= function() { alert(this.prop); }; var myDemo = new Demo();
var Demo = function() { this.prop = 'text'; }; Demo.prototype.action
= function() { alert(this.prop); }; var myDemo = new Demo();
• • • • • • • •
Object.create(myProtoObject); var obj = Object.create(null); // returns { } obj.toString();
// ERROR
var Demo = function() { this.prop = 'text'; }; Demo.prototype.action
= function() { alert(this.prop); }; var myDemo = new Demo(); var Demo = { init: function() { this.prop = 'text'; }, action: function() { alert(this.prop); } }; var myDemo = Object.create(Demo); myDemo.init();
None