DRAFT
TypeofArrayIsArray
Misconception:
The typeof operator returns the type of the operand on which it is applied, thus returns the string array
when invoked on an array.
Incorrect
The typeof operator applied on an array returns 'array'
Correct
The typeof operator applied on an array returns 'object'
CorrectionHere is what's right.
Here is what's right.
The typeof
operator returns a proper result for primitive types (Undefined, Null, Boolean, Number, String, Symbol, BigInt).
It does not discriminate between different kinds of objects. JavaScript arrays are standard objects and for this reason typeof
returns
the string object
when applied on an array.