java-script:falsy-truthy-values
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| java-script:falsy-truthy-values [2023/08/09 17:44] – ↷ Page name changed from java-script:falsy-values to java-script:falsy-truthy-values odefta | java-script:falsy-truthy-values [2023/08/09 17:47] (current) – odefta | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Java Script Falsy Values ====== | + | ====== Java Script Falsy and Truthy |
| + | |||
| + | ===== Falsy values | ||
| A falsy value is a value considered false if it's encountered in a boolean context. | A falsy value is a value considered false if it's encountered in a boolean context. | ||
| Line 10: | Line 12: | ||
| - **undefined**: | - **undefined**: | ||
| - **NaN**: "Not a Number" | - **NaN**: "Not a Number" | ||
| + | |||
| + | ===== Truthy values ===== | ||
| + | |||
| + | Everything that is not a falsy value is a truthy value. | ||
| + | This includes: | ||
| + | * **' | ||
| + | * **' | ||
| + | * **[]** | ||
| + | * **{}** | ||
| + | * **function () {}** | ||
| | | ||
java-script/falsy-truthy-values.1691603056.txt.gz · Last modified: 2023/08/09 17:44 by odefta
