Friday, May 31, 2019

React Native/Javascript - How to know that object does not have the property?

Let say :



myVariable.color;
myVariable.height;
myVariable.width;


But sometimes, myVariable only have "color" and "height" property.



I have try this, but no luck :




if(myVariable.width == undefined) {
//but not filtered here
}


How to know if myVariable doesn't contain "width" property by code, is it possible ?

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...