通过obj.constructor.name获取当前实例对象的构造函数名;
function Person(name){ this.name = name; } var lilei = new Person("Lilei"); lilei.constructor.name; // "Person" [1,2,4].constructor.name; // "Array" (function(){}.constructor.name); // "Function" "hello".constructor.name; // "String"