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
51
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
54
ReactJS Awesomeness
swaroopsm
3
250
Testing JavaScript like a "BOSS"
swaroopsm
0
54
Other Decks in Technology
See All in Technology
Google Cloud Next '24でブログを10本書いた方法と勉強会を沸かせた方法
yasumuusan
0
330
いいたいことちゃんという
tkengo
0
230
生産性向上チームの紹介
cybozuinsideout
PRO
1
920
障害対応をちょっとずつよくしていくための 演習の作りかた
heleeen
1
1.7k
Improve Your Development Workflow with Gemini Code Assist
meteatamel
0
130
MixIT 2024 - Pulumi : Gérer son infra avec son langage de programmation préféré
ju_hnny5
1
120
AOAI をきっかけに 社内の Azure 管理を見直した話
recruitengineers
PRO
1
450
Gradle Build Scanを使ってビルドのことを知ろう potatotips #87
tomorrowkey
2
160
MLOpsの「壁」を乗り越える、LINEヤフーの Data Quality as Code
lycorptech_jp
PRO
8
620
本当のAWS基礎
toru_kubota
1
630
[新卒向け研修資料] テスト文字列に「うんこ」と入れるな(2024年版)
infiniteloop_inc
5
18k
今年のRubyKaigiはProfiler Year🤘
osyoyu
0
360
Featured
See All Featured
Become a Pro
speakerdeck
PRO
13
4.6k
The Illustrated Children's Guide to Kubernetes
chrisshort
32
46k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
34
8.9k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
33
6k
Being A Developer After 40
akosma
66
580k
Web Components: a chance to create the future
zenorocha
306
41k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
228
16k
Design by the Numbers
sachag
274
18k
jQuery: Nuts, Bolts and Bling
dougneiner
59
7.2k
Raft: Consensus for Rubyists
vanstee
133
6.3k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
65
14k
Rebuilding a faster, lazier Slack
samanthasiow
74
8.2k
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