From 68fc8e96a9629e73469ed457abd955e548ec670c Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Thu, 11 Feb 2021 14:49:58 +0100 Subject: unslug pt-br: move --- files/pt-br/glossary/truthy/index.html | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 files/pt-br/glossary/truthy/index.html (limited to 'files/pt-br/glossary/truthy') diff --git a/files/pt-br/glossary/truthy/index.html b/files/pt-br/glossary/truthy/index.html new file mode 100644 index 0000000000..872e53df91 --- /dev/null +++ b/files/pt-br/glossary/truthy/index.html @@ -0,0 +1,34 @@ +--- +title: Truthy +slug: Glossario/Truthy +tags: + - CodingScripting + - Glossário + - JavaScript +translation_of: Glossary/Truthy +--- +

Em {{Glossary("JavaScript")}}, um valor truthy é um valor que se traduz em verdadeiro quando avaliado em um contexto {{Glossary("Booleano")}}. Todos os valores são truthy a menos que eles sejam definidos como {{Glossary("Falsy", "falsy")}} (ou seja., exceto para false, 0, "", null, undefined, e NaN).

+ +

O {{Glossary("JavaScript")}} usa {{Glossary("Type_Conversion", "coerção")}} de tipo em contextos booleanos.

+ +

Exemplos de valores truthy em JavaScript (que se traduzirão em true, e então executar o bloco if):

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

Veja também

+ + -- cgit v1.2.3-54-g00ecf