Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道我们可以使用 object.constructor.name 来获取 javascript 面向对象编程中的类名。但是是否有获取实例名称的功能。
例如:
function className(){ this.getName = function(){ alert(this.InstanceName); }; } objectA = new className(); objectA.getName();
如何打印“objectA”?