From 7bef9cc3a2b78a1be58ffef2cb31cdf66b6c518f Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Sat, 23 Oct 2021 00:32:31 +0900 Subject: Glossary/Truthy を更新 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 2021/10/23 時点の英語版に同期 --- files/ja/glossary/truthy/index.md | 43 +++++++++++---------------------------- 1 file changed, 12 insertions(+), 31 deletions(-) diff --git a/files/ja/glossary/truthy/index.md b/files/ja/glossary/truthy/index.md index 3d62da159f..f881bb3117 100644 --- a/files/ja/glossary/truthy/index.md +++ b/files/ja/glossary/truthy/index.md @@ -1,20 +1,20 @@ --- -title: Truthy +title: Truthy (真値) slug: Glossary/Truthy tags: - CodingScripting - - Glossary - - JavaScript - 用語集 + - JavaScript translation_of: Glossary/Truthy --- -

{{Glossary("JavaScript")}} において、 truthy は {{Glossary("Boolean")}} コンテキストに現れた時に true とみなされる値のことです。 {{Glossary("Falsy", "falsy")}} として定義された値 (つまり、false, 0, -0, 0n, "", null, undefined, NaN) を除くすべての値は truthy です。

+{{Glossary("JavaScript")}} において、**真値** (truthy) は{{Glossary("Boolean", "論理値")}}のコンテキストに現れた時に `true` とみなされる値のことです。{{Glossary("Falsy", "偽値 (falsy)")}} として定義された値 (つまり、`false`, `0`, `-0`, `0n`, `""`, `null`, `undefined`, `NaN`) を除くすべての値は真値です。 -

{{Glossary("JavaScript")}} は、 Boolean コンテキストでは{{Glossary("Type_Conversion", "型変換")}}を用います。

+{{Glossary("JavaScript")}} は、論理値のコンテキストでは{{Glossary("Type_Conversion", "型変換")}}を用います。 -

JavaScript で truthy な値の例です (boolean コンテキストではこれらの値を true と評価し、if ブロックを実行します)。

+JavaScript で _truthy_ な値の例です (論理値のコンテキストではこれらの値を `true` と評価し、`if` ブロックを実行します)。 -
if (true)
+```js
+if (true)
 if ({})
 if ([])
 if (42)
@@ -27,29 +27,10 @@ if (3.14)
 if (-3.14)
 if (Infinity)
 if (-Infinity)
-
- -

仕様書

- - - - - - - - - - - - -
仕様書
{{SpecName("ESDraft", "#sec-toboolean", "ToBoolean abstract operation")}}
- -

関連情報

+``` - +## 関連情報 -
{{QuickLinksWithSubpages("/ja/docs/Glossary")}}
+- {{Glossary("Falsy", "偽値")}} +- {{Glossary("Type_coercion", "型変換")}} +- {{Glossary("Boolean")}} -- cgit v1.2.3-54-g00ecf