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
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
10年間のブログ発信を振り返って見えたWebアプリケーションエンジニアとしての軌跡
stefafafan
0
160
Agile and AI Redmine Japan 2026
hiranabe
3
260
AI時代のコスト管理を考えよう〜明日から使える実践AWSノウハウ~
yoshimi0227
0
290
Claude Codeをどのように キャッチアップしているか
oikon48
13
8.6k
ザ・データベース、MySQL ~ OSC 2026 Sendai ~
sakaik
0
130
新しいUbuntu/GNOMEが使いたいからXからWaylandへ移行頑張ってるの巻 2026-06-20
nobutomurata
0
150
アジャイルな経理と Claude Code と経営の未来
kawaguti
PRO
3
160
GitHub Copilot 最新アップデート – 「一歩先」の実践活用術
moulongzhang
5
1.5k
SONiCで構築・運用する生成AI向けパブリッククラウドネットワーク ~実装編~
sonic
0
280
Kubernetesにおける学習基盤とLLMOpsの概要
ry
1
320
白金鉱業Meetup_Vol.24_「AIエージェントは分けるほど良い」は本当か? / Is it true that “the more you divide AI agents, the better”?
brainpadpr
1
410
AIはどのように 組織のアジリティを変えるのか?
junki
4
1k
Featured
See All Featured
Measuring & Analyzing Core Web Vitals
bluesmoon
9
870
Believing is Seeing
oripsolob
1
150
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
430
Mind Mapping
helmedeiros
PRO
1
250
WCS-LA-2024
lcolladotor
0
650
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.9k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4k
Test your architecture with Archunit
thirion
1
2.3k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
210
It's Worth the Effort
3n
188
29k
The Pragmatic Product Professional
lauravandoore
37
7.3k
Ethics towards AI in product and experience design
skipperchong
2
310
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