Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
joaquinelio wants to merge2 commits intojavascript-tutorial:master
base:master
Choose a base branch
Loading
fromjoaquinelio:falsito
Open
Show file tree
Hide file tree
Changes fromall 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 deletion1-js/02-first-steps/10-ifelse/article.md
View file
Open in desktop
Original file line numberDiff line numberDiff 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 deletion1-js/02-first-steps/11-logical-operators/article.md
View file
Open in desktop
Original file line numberDiff line numberDiff 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

[8]ページ先頭

©2009-2025 Movatter.jp