Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
You don't know JavaScript
Search
C1nde
October 03, 2015
Programming
0
180
You don't know JavaScript
C1nde
October 03, 2015
Tweet
Share
Other Decks in Programming
See All in Programming
Navigating Dependency Injection with Metro
l2hyunwoo
1
160
実は歴史的なアップデートだと思う AWS Interconnect - multicloud
maroon1st
0
240
Cap'n Webについて
yusukebe
0
140
組み合わせ爆発にのまれない - 責務分割 x テスト
halhorn
1
160
LLMで複雑な検索条件アセットから脱却する!! 生成的検索インタフェースの設計論
po3rin
4
890
これならできる!個人開発のすゝめ
tinykitten
PRO
0
120
非同期処理の迷宮を抜ける: 初学者がつまづく構造的な原因
pd1xx
1
740
令和最新版Android Studioで化石デバイス向けアプリを作る
arkw
0
420
AIコーディングエージェント(Gemini)
kondai24
0
250
AIの誤りが許されない業務システムにおいて“信頼されるAI” を目指す / building-trusted-ai-systems
yuya4
6
3.8k
Claude Codeの「Compacting Conversation」を体感50%減! CLAUDE.md + 8 Skills で挑むコンテキスト管理術
kmurahama
1
590
【CA.ai #3】ワークフローから見直すAIエージェント — 必要な場面と“選ばない”判断
satoaoaka
0
270
Featured
See All Featured
How to make the Groovebox
asonas
2
1.8k
Side Projects
sachag
455
43k
SEO for Brand Visibility & Recognition
aleyda
0
4.1k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
0
210
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
0
390
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
110
Practical Orchestrator
shlominoach
190
11k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
47
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
0
22
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
0
68
For a Future-Friendly Web
brad_frost
180
10k
Marketing to machines
jonoalderson
1
4.3k
Transcript
You don’t know JavaScript @C1nde
None
>>> study[0] simple math
>>> [] + [] ""
>>> [] + [] "" >>> {} + {} NaN
>>> [] + [] "" >>> {} + {} NaN
>>> [] + {} "[object Object]"
>>> [] + [] "" >>> {} + {} NaN
>>> [] + {} "[object Object]" >>> {} + [] 0
>>> study[1] Boolean
>>> if (true) { console.log('Will be printed'); } >>> if
(false) { console.log('Will not be printed'); }
>>> if (new Boolean(false)) { console.log('hmmmm'); } hmm
>>> if (new Boolean(false)) { console.log('hmmmm'); } hmm >>> if
(Boolean(false)) { console.log('as expected'); }
>>> study[2] NaN
>>> isNaN(new Date()); false >>> isNaN(new Date('notADate')); true
>>> isNaN(null); false
>>> isNaN(null); false >>> isNaN(undefined); true
>>> isNaN(null); false >>> isNaN(undefined); true >>> undefined == NaN;
false
>>> isNaN(null); false >>> isNaN(undefined); true >>> undefined == NaN;
false >>> NaN == NaN; false
>>> study[3] Object
>>> var o = {}; >>> typeof o "object"
>>> var o = {}; >>> typeof o "object" >>>
o instanceof Object true
>>> typeof null "object"
>>> typeof null "object" >>> null instanceof Object false
>>> study[3] Object^W Null
>>> study[4] RegEx
>>> var lowerCaseOnly = /^[a-z]+$/;
>>> var lowerCaseOnly = /^[a-z]+$/; >>> lowerCaseOnly.test('a'); true >>> lowerCaseOnly.test('A');
false >>> lowerCaseOnly.test(''); false
>>> var lowerCaseOnly = /^[a-z]+$/; >>> lowerCaseOnly.test(null); true >>> lowerCaseOnly.test(undefined);
true >>> lowerCaseOnly.test(); true
>>> study[5] String
>>> 'a string' === 'a string' true
>>> 'a string' === 'a string' true >>> new String('a
string') === 'a string' false
>>> 'a string' === 'a string' true >>> new String('a
string') === 'a string' false >>> String('a string') === 'a string' true
>>> study[6] String & RegEx
>>> var address = 'http://storage. com/gifs/picture.jpg'; >>> address.match('.gif');
>>> var address = 'http://storage. com/gifs/picture.jpg'; >>> address.match('.gif'); /gif
>>> study[7] Object
>>> var obj = { its: 1, an: 2, obj:
3 }; >>> obj.its = null; >>> obj.an = undefined; >>> delete obj.obj;
>>> for(var item in obj) { if (obj.hasOwnProperty(item)) { console.log(item,
obj[item]); } } its null an undefined
>>> study[8] prototype
>>> var obj = {}; >>> var proto = Object.prototype;
>>> proto.isPrototypeOf(obj); false >>> Object.isPrototypeOf(obj); false
>>> var obj = new Object(); >>> var proto =
Object.prototype; >>> proto.isPrototypeOf(obj); false >>> Object.isPrototypeOf(obj); false
>>> var obj = {}; >>> var proto = Object.prototype;
>>> proto === Object.getPrototypeOf (obj); true
>>> study[9] ???
>>> undefined == null; true
[~] > cat check.coffee obj = prop: value if obj.prop?
console.log obj.prop [~] > coffee -b -p check.coffee var obj; obj = { prop: value }; if (obj.prop != null) { console.log(obj.prop); }
THANKS