参考:https://qiita.com/south37/items/c8d20a069fcbfe4fce85

typeof 演算子を使用した場合

プリミティブ型(number、string、boolean、null、undefined)の場合は、判断が可能。
ただし、nullはECMAScript標準規格では独自の型を持つとあるが、objectを返す。
また関数オブジェクトのみ他のオブジェクトとは違い、functionを返す。

typeof 'string'; // 'string'
typeof 1; // 'number'
typeof true; // 'boolean'
typeof null; // 'object'
typeof undefined; // 'undefined'
typeof {}; // 'object'
typeof []; // 'object'
typeof function() {}; // 'function' 関数オブジェクトは特別扱い

Object.prototype.toString を使用した場合

この方法で標準コンストラクタのオブジェクトの型(ArrayやFunctionなど)の判断ができる。
この関数は、オブジェクトの [[Class]] 内部ブロパティの取得が取得でき、出力は [object [Class]] となる。

const toString = Object.prototype.toString;

toString.call({}); // [object Object]  
toString.call([]); // [object Array]
toString.call(function() {}); // [object Function]
toString.call(new Error()); // [object Error]
toString.call(new Date()); // [object Date]
toString.call(JSON); // [object JSON]
toString.call(Math); // [object Math]
toString.call(new RegExp()); // [object RegExp]
toString.call(new String('string')); // [object String]
toString.call('string'); // [object String]
toString.call(new Number(1)); // [object Number]
toString.call(1); // [object Number]
toString.call(new Boolean(true)); // [object Boolean]
toString.call(true); // [object Boolean]
toString.call(null); // [object Null]
toString.call(undefined); // [object Undefined]

独自コンストラクタで生成したオブジェクトの型判断は、constructorプロパティを使用して判断が可能。

function Hoge() {}
var hoge = new Hoge();
Object.prototype.toString.call(hoge); // [object Object]
obj.constructor; // Hoge

またこれ以外で、独自クラスを作成した場合は、instanceof、prototypeチェーン内に独自クラスがある場合には、isPrototypeOfを使用する。