From c058fa0fb22dc40ef0225b21a97578cddd0aaffa Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Thu, 11 Feb 2021 14:51:05 +0100 Subject: unslug ru: move --- files/ru/glossary/truthy/index.html | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 files/ru/glossary/truthy/index.html (limited to 'files/ru/glossary/truthy/index.html') diff --git a/files/ru/glossary/truthy/index.html b/files/ru/glossary/truthy/index.html new file mode 100644 index 0000000000..a99cf53cf9 --- /dev/null +++ b/files/ru/glossary/truthy/index.html @@ -0,0 +1,39 @@ +--- +title: Truthy +slug: Словарь/Truthy +tags: + - Glossary + - JavaScript + - truthy + - Словарь +translation_of: Glossary/Truthy +--- +

В {{Glossary("JavaScript")}}, истинное значение - это значение, которое считается true, когда встречается в контексте {{Glossary("Boolean")}}. Все значения истинные, если они не определены как {{Glossary("Falsy", "falsy")}} (кроме false, 0, -0, 0n, "", null, undefined, и NaN).

+ +

{{Glossary("JavaScript")}} использует {{Glossary("Type_coercion", "приведение типов")}} в Boolean контекстах.

+ +

Примеры истинных значений в JavaScript (которые будут приведены к true в булевых выражениях, и таким образом выполниться блок if):

+ +
if (true)
+if ({})
+if ([])
+if (42)
+if ("0")
+if (new Date())
+if (-42)
+if (12n)
+if (3.14)
+if (-3.14)
+if (Infinity)
+if (-Infinity)
+
+ +

Смотри также

+ + + +
{{QuickLinksWithSubpages("/en-US/docs/Glossary")}}
-- cgit v1.2.3-54-g00ecf