1.typeof 形如 var x = "xx"; typeof x == 'string' typeof(x) 返回类型有:'undefined' “string” 'number' 'boolean' 'function' 'object' 缺点:对于object类型不能细分是什么类型 优点:对空null的判断 'undefined'的应用 2.instanceof 形如 var d = new String('test'); d instanceof String ==true…
1.typeof 形如 var x = "xx"; typeof x == 'string' typeof(x); 返回类型有:'undefined' "string" 'number' 'boolean' 'function' 'object' 缺点:对于object类型不能细分是什么类型 优点:对空null的判断 'undefined'的应用 2.instanceof 形如 var d = new String('test'); d instanceof Str…