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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Swaroop SM
April 10, 2015
Technology
61
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
小さく始める AI 活用推進 ― 日経電子版 Web チームの事例/nikkei-tech-talk47
nikkei_engineer_recruiting
0
300
Kiro Ambassador を目指す話
k_adachi_01
0
110
秘密度ラベル初心者が第1歩でつまづかないための「設計・運用」ポイント
seafay
PRO
0
150
IaC コードを資産へ:AWS CDK 社内ライブラリと横断展開 / aws-summit-japan-2026
gotok365
5
850
Oracle Cloud Infrastructure:2026年6月度サービス・アップデート
oracle4engineer
PRO
0
120
あなたの知らないPDFのアクセシビリティ
lycorptech_jp
PRO
0
220
Agile and AI Redmine Japan 2026
hiranabe
3
240
Oracle AI Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
4
3k
手塩にかけりゃいいってもんじゃない
ming_ayami
0
610
【NRUG vol.18】KubernetesにおけるNew Relicデータ取得量削減の考え方
nrug_member
0
160
2026TECHFRESH畢業分享會 - 原生還是跨平台? App 開發踩坑實錄
line_developers_tw
PRO
0
1.3k
ロボティクスの技術 / Robotics Technology
ks91
PRO
0
110
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
331
21k
Believing is Seeing
oripsolob
1
150
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.3k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
340
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.6k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
370
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
160
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.1k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.5k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
How to make the Groovebox
asonas
2
2.2k
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