获取对象类型的名称是否有相当于Java的JavaScriptclass.getName()?
3 回答
慕姐4208626
TA贡献1852条经验 获得超7个赞
function Square(){ this.className = "Square"; this.corners = 4;}var MySquare = new Square();console.log(MySquare.className); // "Square"
添加回答
举报
0/150
提交
取消