bigt95nt0110
bigt95nt0110

Reputation: 39

How to get object type

Given an arbitrary array of kineticjs objects there a way to get the object type?

var ary = new Array();

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

Please comment

Upvotes: 0

Views: 46

Answers (1)

markE
markE

Reputation: 105035

Yes, use myObject.className

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

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

Upvotes: 1

Related Questions