Tricky Values in JavaScript
Tricky Values in JavaScript: Equality and Truthy Values, Missing Values: null, undefined, ?. and ??.
Updated
- Equality and Truthy Values (Apprentice): JavaScript has a loose == that converts types before comparing and a strict === that doesn't, and it treats every value as truthy or falsy in a condition, so you learn which to use and where 0 and empty text trip people up.
- Missing Values: null, undefined, ?. and ?? (Apprentice): Real data has holes, so learn the difference between undefined and null, read a property that might be missing with ?., and give a missing value a default with ?? instead of ||.