"foo" instanceof String //=> false "foo" instanceof Object //=> false true instanceof Boolean //=> false true instanceof Object //=>
You can use constructor property:
'foo'.constructor == String // returns true true.constructor == Boolean // returns true