Tom Barrasso (2019-05-09T18:52:02.000Z)
contact at tombarrasso.com (2019-05-09T18:53:42.023Z)
Like Symbol.hasInstance but for the "in" operator. This symbol would work for both native and user-defined objects. **Example implementation** prototyping native object: ```js String.prototype[Symbol.inObject] = function(searchString) { return this.includes(searchString) } ``` **Example implementation** for user-defined object: ```js function range(min, max) => ({ [Symbol.inObject]: (prop) => { return (prop >= min && prop <= max) } }) ``` **Example usage**: ```js ("foo" in "food") // true (14 in range(1, 25)) // true ```