...

/

if-statements, continued

if-statements, continued

Learn what truthy and falsey mean in JavaScript. Learn how to make if-statements more powerful.

We'll cover the following...

“Truthy” and “Falsey”

If-statements don’t work only with booleans. We can use any variable type inside the if-statement parentheses.

If we don’t use true or false variables, JavaScript will forcibly coerce whatever we put inside the parentheses to true or false. It’ll then decide whether to run the code or not.

A ...

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy