From 904a5994c87295d84d25f869d5555f35fbce5070 Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Thu, 11 Feb 2021 14:51:56 +0100 Subject: unslug vi: move --- files/vi/glossary/truthy/index.html | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 files/vi/glossary/truthy/index.html (limited to 'files/vi/glossary/truthy') diff --git a/files/vi/glossary/truthy/index.html b/files/vi/glossary/truthy/index.html new file mode 100644 index 0000000000..e9b5b23291 --- /dev/null +++ b/files/vi/glossary/truthy/index.html @@ -0,0 +1,33 @@ +--- +title: Truthy +slug: Tu-dien-thuat-ngu/Truthy +translation_of: Glossary/Truthy +--- +

Trong {{Glossary("JavaScript")}}, truthy là giá trị được hiểu là true trong ngữ cảnh {{Glossary("Boolean")}}. Tất cả mọi giá trị đều là truthy, trừ phi chúng được định nghĩa là {{Glossary("Falsy", "falsy")}} (tức là, ngoại trừ false, 0, "", null, undefined, và NaN).

+ +

{{Glossary("JavaScript")}} dùng {{Glossary("Type_Conversion", "ép kiểu")}} trong ngữ cảnh Boolean.

+ +

Ví dụ về giá trị truthy trong JavaScript (sẽ được ép kiểu thành true trong ngữ cảnh Boolean, và đương nhiên thực hiện mã nguồn trong khối if):

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

Xem thêm

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