标签:
都会返回类型信息,但installedof与内存中的比较typeof与字符串比较
//objects var Person = function() {} var gary = new Person(); console.log(typeof(gary)); // "object" gary instanceof Person // true //literals var str = ‘hello world‘; console.log(typeof(str)); // "string" str instanceof String // False var str1 = new String(‘hello world‘); console.log(typeof(str1)) // "object" str1 instanceof String // true
标签:
原文地址:http://www.cnblogs.com/xiaqi/p/4545417.html