string类型


 var a = "a"
 typeof  a === "string"

number类型


 let a = 111
 typeof  a === "number"

function类型


 var a = function(){}
 typeof  a === "function"

undefined类型


var a =undefined
 typeof  a === "undefined"
a === undefined

Array类型


var a = []
a instanceof Array
Array.isArray(a)

null类型


var a =null
a instanceof null
a === null

RegExp类型


var a = /a/g
a instanceof RegExp

Object类型


var a = {}
typeof a === "object"
a instanceof Object

注意:Object,Array,null,RegExp都会判断为Object,请把Object放在最后一种类型判断