-
Notifications
You must be signed in to change notification settings - Fork 3
評価の流れに関する図を追加 #951
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
評価の流れに関する図を追加 #951
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -83,6 +83,9 @@ const canRideRollerCoasters = age >= 10 && height >= 120; // true | |||
|
|
||||
| 次のコードは何を表示するでしょうか。そしてそれはなぜでしょうか。 | ||||
|
|
||||
| - JavaScript で、数値と論理値に比較<Term>演算子</Term>を適用すると、`true`は`1`として、`false`は`0`として比較されます。 | ||||
chvmvd marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
| - `=`は代入演算子です。代入<Term>演算子</Term>の<Term>式</Term>が<Term>評価</Term>されると、右辺の<Term>値</Term>になります。 | ||||
|
|
||||
|
Comment on lines
+86
to
+88
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. この文言はもとのままです。 |
||||
| {/* prettier-ignore */} | ||||
| ```javascript | ||||
| let takaoHeight = 599; | ||||
|
|
@@ -94,8 +97,18 @@ document.write(takaoHeight = everestHeight); | |||
|
|
||||
| <ViewSource url={import.meta.url} path="_samples/weird-comparison" /> | ||||
|
|
||||
| - JavaScript で、数値と論理値に比較<Term>演算子</Term>を適用すると、`true`は`1`として、`false`は`0`として比較されます。 | ||||
| - `=`は代入演算子です。代入<Term>演算子</Term>の<Term>式</Term>が<Term>評価</Term>されると、右辺の<Term>値</Term>になります。 | ||||
| <Answer> | ||||
|
|
||||
| `<`の結合規則は左から右なので、`takaoHeight < everestHeight < fujiHeight`は`(takaoHeight < everestHeight) < fujiHeight`と解釈されることになります。 | ||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. この文言と同様に書きました cf.
|
||||
| まず`takaoHeight < everestHeight`が<Term>評価</Term>され、`true`になります。次に`true < fujiHeight`が<Term>評価</Term>されます。`true`は`1`として比較されるため、結果は`true`になります。 | ||||
|
|
||||
|  | ||||
|
|
||||
| `takaoHeight = everestHeight`の評価結果は、右辺の評価結果である`8849`になります。 | ||||
|
|
||||
|  | ||||
|
|
||||
| </Answer> | ||||
|
Comment on lines
+100
to
+111
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 解答および解説がなかったため、解説の図を追加するのに伴い、簡単に解説を書きました。 |
||||
|
|
||||
| ::: | ||||
|
|
||||
|
|
||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
他の評価の図と同じ形式にしました。