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
You don't know JavaScript
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
Oxlintはいいぞ
yug1224
5
1.3k
AIによるイベントストーミング図からのコード生成 / AI-powered code generation from Event Storming diagrams
nrslib
2
1.8k
登壇資料を作る時に意識していること #登壇資料_findy
konifar
3
920
CSC307 Lecture 02
javiergs
PRO
1
770
Amazon Bedrockを活用したRAGの品質管理パイプライン構築
tosuri13
4
240
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
190
組織で育むオブザーバビリティ
ryota_hnk
0
170
CSC307 Lecture 07
javiergs
PRO
0
550
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
CSC307 Lecture 06
javiergs
PRO
0
680
高速開発のためのコード整理術
sutetotanuki
1
380
AI Agent の開発と運用を支える Durable Execution #AgentsInProd
izumin5210
7
2.3k
Featured
See All Featured
Designing Powerful Visuals for Engaging Learning
tmiket
0
220
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
Writing Fast Ruby
sferik
630
62k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.6k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
220
Context Engineering - Making Every Token Count
addyosmani
9
650
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
180
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
420
Mind Mapping
helmedeiros
PRO
0
75
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
61
52k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
280
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2k
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