
Asad I. answered 01/01/20
Experienced Javascript, php, html and React Native Tutor.
JavaScript provides us with two different ways to find out if a property exists in an object. One uses the hasOwnProperty() method and the other uses the in keyword. If we have an object usersList with a property of Chris, we could check for its presence in either of the following ways:
similarly you can achieve the same result with in keyword:
Let me know in the comments if you have any confusion.