The typeof keyword is used to differentiate primitive types in JavaScript. It will returns one of nine strings:

undefined, object(meaning null), boolean, number, bigint, string, symbol, function, or object(meaning any object, including arrays).

The typeof operator is useful because it is an easy way to check the type of a…

--

--