/*\n'typeof' and 'instanceof' isn't a reliable method to find \nout the object class, so this is a function that does this in a more trustable way.\n*/\n\nfunctionis(type,obj){\nvarclazz=Object.prototype.toString.call(obj).slice(8,-1);\nreturnobj!==undefined&&obj!==null&&clazz===type;\n}\n\nis('String','test');// true\nis('String',newString('test'));// true\n