Skip to content

Link to the "falsy" term issue #3851 #3852

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 1-js/02-first-steps/10-ifelse/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if (year == 2015) {

We recommend wrapping your code block with curly braces `{}` every time you use an `if` statement, even if there is only one statement to execute. Doing so improves readability.

## Boolean conversion
## Boolean conversion [#boolean-conversion]

The `if (…)` statement evaluates the expression in its parentheses and converts the result to a boolean.

Expand Down
2 changes: 1 addition & 1 deletion 1-js/02-first-steps/11-logical-operators/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ alert( false || false ); // false

As we can see, the result is always `true` except for the case when both operands are `false`.

If an operand is not a boolean, it's converted to a boolean for the evaluation.
If an operand is not a boolean, it's converted to a boolean for the evaluation. This is part of the familiar [truthy/falsy](info:ifelse#boolean-conversion) concept.

For instance, the number `1` is treated as `true`, the number `0` as `false`:

Expand Down