Tom Barrasso (2019-05-09T18:52:02.000Z)
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
```
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20190509/ab304f1e/attachment.html>
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
```