Truthy and Falsy


#1

I’m trying to understand the concepts of Truthy and Falsy. In the example we were asked to change the value of wordcount to something other than 0. At 0 I believe that the value was falsy and when we changed it to something other than 0 it was truthy. I don’t really understand what this means and would like it if someone could explain what these terms mean in simple terms and how it might be used in real world.

https://www.codecademy.com/courses/learn-javascript-control-flow/lessons/control-flow/exercises/true-false-values?action=resume_content_item&course_redirect=introduction-to-javascript


#2

These are falsy

0
''
""
undefined
null
NaN

Everything else is truthy.