--- Restore content start ---
Ecmascript has five primitive types: undefined, null, Boolean, number, and string.
1. typeof Operator
The typeof operator has a parameter, that is, the variable or value to be checked.
For example:
VaR EMP = "Hello World ";
Alert (typeof EMP); // output "string"
Alert (typeof 100); // output "Number"
---- If the variable is of the undefined type, undefined is returned;
---- If the variable is of the boolean type, the return value is boolean;
---- If the variable is of the number type, return number;
---- If the variable is of the string type, the return value is string;
---- If the variable is of the reference or null type, the object is returned.
Note: The typeof operator returns "object" for the null value, which is actually an error in the initial implementation of JavaScript and is followed by ecmascript. Now null is considered a placeholder for an object, which explains this contradiction, but technically it is still the original value.
2. Number Type
This data type can be a 32-bit integer or a 64-bit floating point number.
What's interesting about floating point literal is that before using it for computation, strings are actually stored.
Extended knowledge points:
① Common division functions
② Common multiplication Functions
Original ecmascript type