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
1
59
The Truth About Truthy & Falsy
Deck demonstrating which values are truthy / falsy w.r.t a programming language.
Swaroop SM
April 10, 2015
Tweet
Share
More Decks by Swaroop SM
See All by Swaroop SM
Client-Side Data Modelling and more...
swaroopsm
0
62
ReactJS Awesomeness
swaroopsm
3
260
Testing JavaScript like a "BOSS"
swaroopsm
0
65
Other Decks in Technology
See All in Technology
OpenClaw を Amazon Lightsail で動かす理由
uechishingo
0
250
【Λ(らむだ)】最近のアプデ情報 / RPALT20260318
lambda
0
140
スピンアウト講座02_ファイル管理
overflowinc
0
450
Goのerror型がシンプルであることの恩恵について理解する
yamatai1212
1
280
TypeScript 7.0の現在地と備え方
uhyo
7
2k
Phase10_組織浸透_データ活用
overflowinc
0
570
Escape from Excel方眼紙 ~マークダウンで繋ぐ、人とAIの架け橋~ /nikkei-tech-talk44
nikkei_engineer_recruiting
0
150
Zero Data Loss Autonomous Recovery Service サービス概要
oracle4engineer
PRO
2
13k
詳解 強化学習 / In-depth Guide to Reinforcement Learning
prinlab
0
350
Windows ファイル共有(SMB)を再確認する
murachiakira
PRO
0
210
君はジョシュアツリーを知っているか?名前をつけて事象を正しく認識しよう / Do you know Joshua Tree?
ykanoh
2
100
"作る"から"使われる"へ:Backstage 活用の現在地
sbtechnight
0
230
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.3k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.3k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.2k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
120
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
150
Deep Space Network (abreviated)
tonyrice
0
94
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
110k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
450
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
240
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
120
First, design no harm
axbom
PRO
2
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