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:


Leave a Reply

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