Reputation: 475
I want to list all members of a qooxdoo object. I found a way to do it, but I assume there must be a cleaner way?
for (var key in obj) {
if (key.startsWith('$$user_')) {
msg += 'name='+key.substring(7)+' = '+obj[key]+' [type='+typeof(obj[key])+']';
}
}
Upvotes: 3
Views: 170
Reputation: 181
Assuming it is properties you are interested in, you can use
var classProperties = qx.util.PropertyUtil.getAllProperties(obj.constructor);
for(var propertyName in classProperties) {
...
}
Upvotes: 4