基于 typeof
console.log(typeof 1) // number
console.log(typeof '1') // string
基于 Object.prototype.toString
const toString = Object.prototype.toString
console.log(toString.call([])) // [object Array]
console.log(toString.call({})) // [object Object]
基于 constructor.name
function Foo() {}
console.log((new Foo).constructor.name) // "Foo"