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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
開発者から情シスまで - 多様なユーザー層に届けるAPI提供戦略 / Postman API Night Okinawa 2026 Winter
tasshi
0
200
dchart: charts from deck markup
ajstarks
3
990
Fragmented Architectures
denyspoltorak
0
150
コントリビューターによるDenoのすゝめ / Deno Recommendations by a Contributor
petamoriken
0
200
AIによる高速開発をどう制御するか? ガードレール設置で開発速度と品質を両立させたチームの事例
tonkotsuboy_com
7
2.2k
CSC307 Lecture 03
javiergs
PRO
1
490
なるべく楽してバックエンドに型をつけたい!(楽とは言ってない)
hibiki_cube
0
140
AIフル活用時代だからこそ学んでおきたい働き方の心得
shinoyu
0
130
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
710
CSC307 Lecture 05
javiergs
PRO
0
500
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
600
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
190
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Paper Plane
katiecoart
PRO
0
46k
A Soul's Torment
seathinner
5
2.2k
Deep Space Network (abreviated)
tonyrice
0
47
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
910
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
270
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.1k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
0
140
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
320
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.8k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
160
Navigating Team Friction
lara
192
16k
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