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
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
頼れる Agentic AI を支える Datadog のオブザーバビリティ / Powering Reliable Agentic AI with Datadog Observability
aoto
PRO
0
250
AIエージェント×GitHubで実現するQAナレッジの資産化と業務活用 / QA Knowledge as Assets with AI Agents & GitHub
tknw_hitsuji
0
130
新規事業×QAの挑戦:不確実性を乗りこなす!フェーズごとに求められるQAの役割変革
hacomono
PRO
0
140
VPCエンドポイント意外とお金かかるなぁ。せや、共有したろ!
tommy0124
1
720
「お金で解決」が全てではない!大規模WebアプリのCI高速化 #phperkaigi
stefafafan
4
2.1k
Escape from Excel方眼紙 ~マークダウンで繋ぐ、人とAIの架け橋~ /nikkei-tech-talk44
nikkei_engineer_recruiting
0
150
Phase05_ClaudeCode入門
overflowinc
0
720
"作る"から"使われる"へ:Backstage 活用の現在地
sbtechnight
0
230
スピンアウト講座02_ファイル管理
overflowinc
0
430
Windows ファイル共有(SMB)を再確認する
murachiakira
PRO
0
210
visionOS 開発向けの MCP / Skills をつくり続けることで XR の探究と学習を最大化
karad
1
1.2k
生成AIで速度と品質を両立する、QAエンジニア・開発者連携のAI協調型テストプロセス
shota_kusaba
0
330
Featured
See All Featured
The SEO identity crisis: Don't let AI make you average
varn
0
420
Agile that works and the tools we love
rasmusluckow
331
21k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Typedesign – Prime Four
hannesfritz
42
3k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.3k
Designing for Performance
lara
611
70k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
450
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
320
Abbi's Birthday
coloredviolet
2
5.5k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
130
Evolving SEO for Evolving Search Engines
ryanjones
0
160
The untapped power of vector embeddings
frankvandijk
2
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