Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
The Truth About Truthy & Falsy
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Swaroop SM
April 10, 2015
Technology
64
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
66
ReactJS Awesomeness
swaroopsm
3
260
Testing JavaScript like a "BOSS"
swaroopsm
0
75
Other Decks in Technology
See All in Technology
幾何アルゴリズムで なめらかなピン操作を / iOSDC Japan 2026 / smoothpin
kazumanagano
0
360
`t*(42&t>>10)`だけで音楽が鳴る、Swiftで実装するBytebeat / iOSDC Japan 2026
yutailang0119
0
120
Cloudflare Workers 向けアプリを C# で構築する ~WASM Native AOT への道~
nenonaninu
1
650
人間はどの意思決定を手放せるのか
kawasima
15
7.7k
SREへの勘違いに気づいた後の話
tomodakengo
0
120
ユーザー価値を届け続けるためにウォンテッドリーが大切にしている文化
kotaminato
0
190
CLIライブラリ開発を支える技術
htnabe
0
140
負債のメタファと2026年 / Debt Metaphor in Agentic Engineering Age 202609 Edition
twada
PRO
10
4.5k
研究開発部の紹介 / Sansan R&D Profile
sansan33
PRO
5
25k
GoのInterface内部構造から学ぶ!最高パフォーマンスを出すコード設計
yappli_developers
1
210
俺の仕事は AIに奪われないし、たぶんその BIも要らない
hikaruri
0
530
データ界隈LT祭 第1回LT登壇
taromatsui_cccmkhd
2
1.5k
Featured
See All Featured
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
660
SEO for Brand Visibility & Recognition
aleyda
0
4.7k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.2k
Why Our Code Smells
bkeepers
PRO
340
58k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
2k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Agile that works and the tools we love
rasmusluckow
331
22k
GitHub's CSS Performance
jonrohan
1033
470k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
エンジニアに許された特別な時間の終わり
watany
109
250k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.6k
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