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
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
ここは地獄!つらい朝会を体験することで、チームとしてのより良い振る舞いに気づくワークショップ / The stand-up meeting from hell in the game industry
scrummasudar
0
410
新たなDBアーキテクチャ「LTAP」にDeep Dive!!
inoutk
0
140
VPCセキュリティ対応の最新事情
nagisa53
1
340
Claude Code並行開発環境の ムダ‧ムラ‧ムリを見直した話
muranakaaa
0
260
AIエージェントがあれば技術書なんてすぐ書けるでしょ→無理でした
watany
6
1.1k
WEBフロントエンド研修【MIXI 26新卒技術研修】
mixi_engineers
PRO
1
680
AIがAPIを書く時代に、私たちは何を設計すべきか
nagix
0
120
Webアプリ認証の全体像 / The Big Picture of Web App Authentication
kitano_yuichi
1
480
A Bag-of-Documents Model for Query Specificity
dtunkelang
0
150
CloudWatchから始めるAWS監視
butadora
0
270
AI Native なプロダクト組織の立ち上げ方 : 生産性 100 倍への挑戦
mikesorae
0
1.7k
AIとハーネスで育てるトランスコンパイラ / 20260722 Yasushi Katayama
shift_evolve
PRO
4
1.1k
Featured
See All Featured
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
610
Designing for Timeless Needs
cassininazir
1
410
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
67
56k
Making Projects Easy
brettharned
120
6.7k
HDC tutorial
michielstock
2
760
Game over? The fight for quality and originality in the time of robots
wayneb77
1
230
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
65
57k
Six Lessons from altMBA
skipperchong
29
4.4k
Design in an AI World
tapps
1
270
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
Raft: Consensus for Rubyists
vanstee
141
7.6k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
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