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
Swaroop SM
April 10, 2015
Technology
62
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
64
ReactJS Awesomeness
swaroopsm
3
260
Testing JavaScript like a "BOSS"
swaroopsm
0
73
Other Decks in Technology
See All in Technology
アクセスキーこわい やめかたと漏らさない工夫
sassssan68
1
410
GoのInterface内部構造から学ぶ!最高パフォーマンスを出すコード設計
yappli_developers
0
150
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
12k
Minecraft JavaのMODをSwiftで作る
1mash0
0
180
【技術的負債conf】事業成長に伴う技術的負債の説明責任とAIによるモニタリング、認知的負債について
i35_267
3
1.7k
現場で役立つ技術負債の効果的な返済方法
masuda220
PRO
9
4.5k
エージェントはローカル、検証はMicroVM — Lambda MicroVMsでつくるServerless CI
fujioka6789
3
330
SREへの勘違いに気づいた後の話
tomodakengo
0
110
あけおめLINE 傾向とその対策
nasa9084
0
140
株式会社シーエーシー エンジニア向け会社紹介資料
cac
0
57k
aws-iot-platform-architecture-use-cases.pdf
ma2shita
0
310
越境するなら専門用語を使うな高校校歌 / If you wanna cross border, you shouldn't use jargon
vtryo
0
140
Featured
See All Featured
Building an army of robots
kneath
307
46k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
4.8k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
1k
Faster Mobile Websites
deanohume
310
32k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Practical Orchestrator
shlominoach
192
12k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.3k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
510
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.9k
Navigating Team Friction
lara
192
16k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
360
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