1、Array
const a = []
const b = {}
console.log(Array.isArray(a)) // true
console.log(Array.isArray(b)) // false
2、Map
const a = new Map()
const b = {}
console.log(Object.prototype.toString.call(a) == '[object Map]') // true
console.log(Object.prototype.toString.call(b) == '[object Map]') // false
3、Set
const a = new Set()
const b = {}
console.log(Object.prototype.toString.call(a) == '[object Set]') // true
console.log(Object.prototype.toString.call(b) == '[object Set]') // false
4、Date
const a = new Date()
const b = {}
console.log(Object.prototype.toString.call(a) == '[object Date]') // true
console.log(Object.prototype.toString.call(b) == '[object Date]') // false
5、RegExp
const a = new RegExp()
const b = {}
console.log(Object.prototype.toString.call(a) == '[object RegExp]') // true
console.log(Object.prototype.toString.call(b) == '[object RegExp]') // false
6、Funtion
const a = () => {}
const b = {}
console.log(typeof a == 'function') // true
console.log(typeof b == 'function') // false
7、String
const a = '123'
const b = 123
console.log(typeof a == 'string') // true
console.log(typeof b == 'string') // false
8、Symbol
const a = Symbol(123)
const b = {}
console.log(typeof a == 'symbol') // true
console.log(typeof b == 'symbol') // false
9、Object
const a = {}
const b = 123
console.log(a !== null && typeof a == 'object') // true
console.log(b !== null && typeof b == 'object') // false
10、Promise
const a = new Promise(() => {},() => {})
const b = 123
console.log(a !== null && typeof a.then == 'function' && typeof a.catch == 'function') // true
console.log(b !== null && typeof b.then == 'function' && typeof b.catch == 'function') // false