in operator - JavaScript | MDN
If you delete a property with the operator, the in operator returns false for that property. If you set a property to but do not delete it, the in operator returns true for that property. The in operator will return false for empty array slots. Even if accessing it directly returns undefined.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/in