Types

Types

Credits: illustration by unDraw‚Äč

1. Why NaN is a number?

Example:

typeof NaN; // "number"

TODO: explanation

2. Conversion to String()

Example:

String(null); // "null"
String(undefined); // "undefined"
String([null]); // ""
String([undefined]); // ""

TODO: explanation

3. Conversion to Number()

Example:

Number(null); // 0
Number(undefined); // NaN
Number([null]); // 0
Number([undefined]); // 0

TODO: explanation