[Discourse] Paraphrase "Type" in JS in one time
Here we see a graphic like below:

Now we use "typeof" and "instanceof" these built-in methods to inspect them.
instanceof
You can't do any of
instanceofoperation on the top row, it's special to the left coloum.
Theinstanceofoperation to left coloum will either equal to their specific type OR "Object" type.
typeof
typeofto any item will return it's corresponding type in the top row except null, it will returnobject. It's a buggy for 2 decades.
typeofto any item will return it'sobjecttype in the left coloum exceptFunction. it's will returnfunction.
Need to be mentioned
Basic type : object, string, number, boolean, null, undefined. Not include
function.
Object type: Object, String, Number, Boolean, Function, Array, Date, RegExp, Error

浙公网安备 33010602011771号