javascript - KineticJS enumerate data types of an Object -
the code below enumerate properties of object, can data types enumerated?
function enumerateattributes(node){ var text=""; var attrs=circle1.getattrs(); (key in attrs) { if (attrs.hasownproperty(key)) { text+=(key+"=="+attrs[key]+"\n"); } } alert(text); }
for javascript data types can use typeof: console.log(typeof attrs[key]);
these common types returned:
- null,
- undefined,
- object,
- boolean,
- number,
- string,
- function
Comments
Post a Comment