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
53
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
56
ReactJS Awesomeness
swaroopsm
3
260
Testing JavaScript like a "BOSS"
swaroopsm
0
55
Other Decks in Technology
See All in Technology
複雑なState管理からの脱却
sansantech
PRO
1
150
AWS Media Services 最新サービスアップデート 2024
eijikominami
0
200
いざ、BSC討伐の旅
nikinusu
2
780
OS 標準のデザインシステムを超えて - より柔軟な Flutter テーマ管理 | FlutterKaigi 2024
ronnnnn
0
170
The Rise of LLMOps
asei
7
1.6k
インフラとバックエンドとフロントエンドをくまなく調べて遅いアプリを早くした件
tubone24
1
430
誰も全体を知らない ~ ロールの垣根を超えて引き上げる開発生産性 / Boosting Development Productivity Across Roles
kakehashi
1
230
New Relicを活用したSREの最初のステップ / NRUG OKINAWA VOL.3
isaoshimizu
2
620
AWS Lambdaと歩んだ“サーバーレス”と今後 #lambda_10years
yoshidashingo
1
180
ExaDB-D dbaascli で出来ること
oracle4engineer
PRO
0
3.9k
rootlessコンテナのすゝめ - 研究室サーバーでもできる安全なコンテナ管理
kitsuya0828
3
390
SSMRunbook作成の勘所_20241120
koichiotomo
3
160
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
327
21k
Practical Orchestrator
shlominoach
186
10k
GitHub's CSS Performance
jonrohan
1030
460k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Navigating Team Friction
lara
183
14k
The World Runs on Bad Software
bkeepers
PRO
65
11k
What's in a price? How to price your products and services
michaelherold
243
12k
The Cult of Friendly URLs
andyhume
78
6k
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
The Art of Programming - Codeland 2020
erikaheidi
52
13k
How to train your dragon (web standard)
notwaldorf
88
5.7k
GraphQLとの向き合い方2022年版
quramy
43
13k
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