diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/ja/glossary/truthy | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/ja/glossary/truthy')
-rw-r--r-- | files/ja/glossary/truthy/index.html | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/files/ja/glossary/truthy/index.html b/files/ja/glossary/truthy/index.html new file mode 100644 index 0000000000..3d62da159f --- /dev/null +++ b/files/ja/glossary/truthy/index.html @@ -0,0 +1,55 @@ +--- +title: Truthy +slug: Glossary/Truthy +tags: + - CodingScripting + - Glossary + - JavaScript + - 用語集 +translation_of: Glossary/Truthy +--- +<p>{{Glossary("JavaScript")}} において、 <strong>truthy</strong> は {{Glossary("Boolean")}} コンテキストに現れた時に <code>true</code> とみなされる値のことです。 {{Glossary("Falsy", "falsy")}} として定義された値 (つまり、<code>false</code>, <code>0</code>, <code>-0</code>, <code>0n</code>, <code>""</code>, <code>null</code>, <code>undefined</code>, <code>NaN</code>) を除くすべての値は truthy です。</p> + +<p>{{Glossary("JavaScript")}} は、 Boolean コンテキストでは{{Glossary("Type_Conversion", "型変換")}}を用います。</p> + +<p>JavaScript で <em>truthy</em> な値の例です (boolean コンテキストではこれらの値を <code>true</code> と評価し、<code>if</code> ブロックを実行します)。</p> + +<pre class="brush: js">if (true) +if ({}) +if ([]) +if (42) +if ("0") +if ("false") +if (new Date()) +if (-42) +if (12n) +if (3.14) +if (-3.14) +if (Infinity) +if (-Infinity) +</pre> + +<h2 id="Specifications" name="Specifications">仕様書</h2> + +<table> + <thead> + <tr> + <th scope="col">仕様書</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName("ESDraft", "#sec-toboolean", "<code>ToBoolean</code> abstract operation")}}</td> + </tr> + </tbody> +</table> + +<h2 id="See_also" name="See_also">関連情報</h2> + +<ul> + <li>{{Glossary("Falsy")}}</li> + <li>{{Glossary("Type_Conversion", "型変換")}}</li> + <li>{{Glossary("Boolean")}}</li> +</ul> + +<div>{{QuickLinksWithSubpages("/ja/docs/Glossary")}}</div> |