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
Swaroop SM
April 10, 2015
Technology
1
56
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
59
ReactJS Awesomeness
swaroopsm
3
260
Testing JavaScript like a "BOSS"
swaroopsm
0
61
Other Decks in Technology
See All in Technology
[2025年10月版] Databricks Data + AI Boot Camp
databricksjapan
1
240
CREが作る自己解決サイクルSlackワークフローに組み込んだAIによる社内ヘルプデスク改革 #cre_meetup
bengo4com
0
270
フレームワークを意識させないワークショップづくり
keigosuda
0
240
コンパウンド組織のCRE #cre_meetup
layerx
PRO
0
210
OSSで50の競合と戦うためにやったこと
yamadashy
3
930
今この時代に技術とどう向き合うべきか
gree_tech
PRO
2
2.1k
Introduction to Sansan Meishi Maker Development Engineer
sansan33
PRO
0
310
Azureコストと向き合った、4年半のリアル / Four and a half years of dealing with Azure costs
aeonpeople
1
250
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
940
アウトプットから始めるOSSコントリビューション 〜eslint-plugin-vueの場合〜 #vuefes
bengo4com
3
150
Introduction to Sansan, inc / Sansan Global Development Center, Inc.
sansan33
PRO
0
2.8k
Introdução a Service Mesh usando o Istio
aeciopires
1
280
Featured
See All Featured
Building an army of robots
kneath
306
46k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.7k
Six Lessons from altMBA
skipperchong
29
4k
How GitHub (no longer) Works
holman
315
140k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
A better future with KSS
kneath
239
18k
Embracing the Ebb and Flow
colly
88
4.9k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Testing 201, or: Great Expectations
jmmastey
45
7.7k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.7k
Designing Experiences People Love
moore
142
24k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
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