As the title says it all, typeof (Array, null) returns object and typeof(null, Array) returns function.
It returns the type of the second parameter.
Why ?
Because
typeof is an operator, not a function, so typeof(expr) is typeof expr, with expr evaluated first
a,b returns bSo
typeof (a, b) returns typeof b
and in your case
typeof (Array, null) is typeof null which is "object"
typeof(null, Array) is typeof Array, and Array is a function.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With