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 Truth About Truthy & Falsy
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Swaroop SM
April 10, 2015
Technology
61
1
Share
The Truth About Truthy & Falsy
Deck demonstrating which values are truthy / falsy w.r.t a programming language.
Swaroop SM
April 10, 2015
More Decks by Swaroop SM
See All by Swaroop SM
Client-Side Data Modelling and more...
swaroopsm
0
63
ReactJS Awesomeness
swaroopsm
3
260
Testing JavaScript like a "BOSS"
swaroopsm
0
68
Other Decks in Technology
See All in Technology
電子辞書Brainをネットに繋げてみた(自力編)
raspython3
0
190
Agentic AI時代における メルカリのAIガバナンスとガードレール実装
naoichihara
15
15k
Copilot CLI・IDE・Web・スマホで途切れない開発フローを目指して / One Copilot flow - CLI IDE Web Mobile
aeonpeople
1
1.1k
個人AIからチームAIへ:開発における品質と生産性の再設計
moongift
PRO
0
160
GitHub Copilot CLI の Rubber Duck 機能を使ってコーディングの品質をあげよう #techbaton_findy
stefafafan
2
1.1k
AI時代に求められる思考のパラダイムシフト
nrinetcom
PRO
1
160
食べログのサーキットブレーカー導入を振り返って
atpons
0
120
AIが変えた"品質の守り方"
kkakizaki
12
4.4k
最低限これだけ押さえれ大丈夫_Claude Enterprise/Team企業展開ガバナンス入門
tkikuchi
1
180
自称宇宙最速で不合格となったAIP-C01にリベンジを果たすべくAIで問題集アプリを作ってみた。
yama3133
0
210
はじめてのAI-DLC
yoshidashingo
2
560
long-running-tasks
cipepser
2
390
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Scaling GitHub
holman
464
140k
Un-Boring Meetings
codingconduct
0
300
ラッコキーワード サービス紹介資料
rakko
1
3.4M
Music & Morning Musume
bryan
47
7.2k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
130
Code Reviewing Like a Champion
maltzj
528
40k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.9k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
370
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Balancing Empowerment & Direction
lara
6
1.1k
Transcript
WTF (What’s Truthy Falsy) Swaroop SM Cybrilla Technologies
- TRUTHY: If the value isn’t literally “true” but evaluates
to true. - FALSY: If the value isn’t literally “false” but evaluates to false. What is it?
undefined 0 false “” null NaN nil [] {} true
True False None
var a = 0; if(a) { alert(“I’m TRUTHY :)”); }
else { alert(“I’m FALSY. Feel so proud. :D”); } The Confusion
TRUTHY - true - 0 - “” - [] -
{} Ruby FALSY - false - nil
Ruby on Rails present? - !blank? - 0 - true
blank? - nil - “” - [] - {} - false - whitespace
Python TRUTHY - True - 1 FALSY - False -
None - 0 - [] - “” - {}
JavaScript TRUTHY - true - “0” - [] - {}
FALSY - 0 - false - “” - undefined - null - NaN
Thank You! @smswaroop http://www.github.com/swaroopsm/truthy-falsy