uhm... typeof isn't a function, it's an operator. Hence your () are unneccessary and are only operating as operator grouping, NOT as a function call to pass parameters to.

console.log(typeof null); // not a function

console.log(typeof foo); // still not a function

console.log(typeof Array); // still not a function

Get it? You don't typeof() because it's NOT a function.

Also a bit of a wonk you don't mention instanceOf, but that's pretty common as people use typeof to the point of obsession when in most cases it's the WRONG OPERATOR!

I used to make that mistake myself.

Written by

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store