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
Code Reuse in Node.js (the short version)
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Makara Wang
April 20, 2013
Programming
91
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Code Reuse in Node.js (the short version)
Makara Wang
April 20, 2013
More Decks by Makara Wang
See All by Makara Wang
Loose Coupling with Message Queue / Bus (the short version)
makara
1
110
Asynchronous JS with Promise (+ Workshop)
makara
0
97
Asynchronous JS with Promise
makara
2
160
Other Decks in Programming
See All in Programming
レビュー履歴をAIに食わせて、 Compose移行を加速するs
shihochan
0
260
Can LLMs Replicate 4 Years of Compose Migration? Exploring the boundaries of automation with 279 XML files from a real product
makun
0
130
AI に Inclusive UI を書かせよう — Design Rules Skill で Compose UI を作り直す
theoriatec2024
1
440
Swift愛好会100回記念 第1回を振り返る
jollyjoester
0
120
Go 1.27からのGODEBUG / Go 1.27 リリースパーティ #go127party
mazrean
0
300
数年滞っていたダークモード対応をおよそ2週間で完了させる
chigichan24
0
670
KotlinConf Extended South Korea 2026 Keynote
l2hyunwoo
0
130
AIに既存システムを理解させる技術 ~レガシーを見捨てないハーネスエンジニアリング入門~
ochtum
0
200
[PyCon KR 2026] More Variants, More Diversity for AI Accelerators
achimnol
0
130
業務時間外もAIに働いてもらう話
colorful12
3
9.9k
一参加者から『中の人』へ 〜全通PHPerがブースに立って学んだ、カンファレンスを100倍楽しむコツ〜
wp_daisuke
0
110
My Marp Sample
sinoue0108
0
140
Featured
See All Featured
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
570
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
720
ラッコキーワード サービス紹介資料
rakko
1
4.7M
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
A Tale of Four Properties
chriscoyier
163
24k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
67k
Building Applications with DynamoDB
mza
96
7.2k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
240
Un-Boring Meetings
codingconduct
0
410
Statistics for Hackers
jakevdp
799
230k
Making the Leap to Tech Lead
cromwellryan
135
10k
Transcript
Code Reuse in Node.js (the short version) ⺩王浩宇 Makara Wang
[email protected]
2013.04.20
Assuming you know... JS & Node.js Prototype “this”
Common ways... Function + Arguments Good for: everything, promise, ...
Common ways... Prototype + Class Good for: modeling... ...or you
really care about performance ...or you want the long prototype chain
Common ways... Function Copy this[key] = that[key]; Good for: simpler
syntax, better syntax, ...
My favorite Function Copy ...with “Object.defineProperties()” Because it’s Node.js (not
a broken browser)
Implementations https://github.com/medikoo/es5-ext require('es5-ext/lib/Object/extend-properties'); https://github.com/devo-ps/carcass carcass.mixable(obj);
(Personal) Notes Use “this” Return “this” Reduce arguments Avoid “bind()”
...
Thanks!