Reputation: 15673
I am iterating over a list of objects of mixed types. For each object I access a bunch of properties. Some of these objects will not have some of the properties. Is there a way to avoid using object.hasProperty method to safely access nonexisting properties?
Upvotes: 0
Views: 969
Reputation: 15673
looks like the only reasonable way is to use hasProperty method for sanity check
Upvotes: 0
Reputation: 526
You could iterate through the object's properties.
The following link might help for this :-
Upvotes: 1