JavaScript in Operator



JavaScript uses the “in” operator to test whether or not properties exist inside of any Object.

If you use the “in” operator inside an if statement or ternary statement then it will return true or false depending on the existence of your indicated property name.

Code GIST: https://gist.github.com/prof3ssorSt3v3/f94d248ef9921a88003bf8b091cdb81a

source

Leave a Reply

Your email address will not be published. Required fields are marked *