diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:41:15 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:41:15 -0500 |
commit | 4b1a9203c547c019fc5398082ae19a3f3d4c3efe (patch) | |
tree | d4a40e13ceeb9f85479605110a76e7a4d5f3b56b /files/de/glossary/truthy/index.html | |
parent | 33058f2b292b3a581333bdfb21b8f671898c5060 (diff) | |
download | translated-content-4b1a9203c547c019fc5398082ae19a3f3d4c3efe.tar.gz translated-content-4b1a9203c547c019fc5398082ae19a3f3d4c3efe.tar.bz2 translated-content-4b1a9203c547c019fc5398082ae19a3f3d4c3efe.zip |
initial commit
Diffstat (limited to 'files/de/glossary/truthy/index.html')
-rw-r--r-- | files/de/glossary/truthy/index.html | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/files/de/glossary/truthy/index.html b/files/de/glossary/truthy/index.html new file mode 100644 index 0000000000..c45968bb32 --- /dev/null +++ b/files/de/glossary/truthy/index.html @@ -0,0 +1,33 @@ +--- +title: Truthy +slug: Glossary/Truthy +translation_of: Glossary/Truthy +--- +<p>In {{Glossary("JavaScript")}} gilt ein Wert als <strong>truthy</strong>, wenn er in einem {{Glossary("Boolean")}} Kontext evaluiert <code>true</code> ergibt. Alle Werte werden als truthy angesehen, solange sie nicht {{Glossary("Falsy", "falsy")}}, also <code>false</code>, <code>0</code>, <code>""</code>, <code>null</code>, <code>undefined</code> oder <code>NaN</code> sind.</p> + +<p>JavaScript benutzt {{Glossary("Type_conversion", "Typ-Konversation")}} in Booleschen Kontexten.</p> + +<h2 id="Beispiele">Beispiele</h2> + +<p>All diese if-statements werden ausgeführt.</p> + +<pre class="brush: js">if (true) +if ({}) +if ([]) +if (42) +if ("foo") +if (new Date()) +if (-42) +if (3.14) +if (-3.14) +if (Infinity) +if (-Infinity) +</pre> + +<h2 id="Siehe_auch">Siehe auch</h2> + +<ul> + <li>{{Glossary("Falsy")}}</li> + <li>{{Glossary("Type_Conversion", "Coercion")}}</li> + <li>{{Glossary("Boolean")}}</li> +</ul> |