如何获取对象类型

时间:2014-04-04 04:15:13

标签: object kineticjs

给定一个kineticjs对象的任意数组,有一种获取对象类型的方法吗?

var ary = new Array();

ary[0] = "Circle Obj";
ary[1] = "rect Obj";
ary[2] = "arc Obj";
ary[0] = "Circle Obj";

请发表评论

1 个答案:

答案 0 :(得分:1)

是的,请使用myObject.className

ary[0]=new Kinetic.Circle({...});

console.log(ary[0].className); // returns "Circle"