Gabe Johnson (2017-07-17T01:54:39.000Z)
> This is definitely something that can be polyfilled (with different
levels of naivety) but requires modifying built-ins which is a no-no.

You can safely modify `Object.prototype` using `Symbol`.

```js
export const tap = Symbol('tap');

Object.prototype[tap] = function tap(f) {
  f(this);
  return this;
}

[1, 2, 3]
  .map(n => n * 2)
  [tap](console.log.bind(console))
  .reduce((a, b) => a + b);
```

No need to add a new method to `Array.prototype` and you can use it with
any type.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20170716/c59cf282/attachment.html>
gijohnson105 at gmail.com (2017-07-17T01:56:02.544Z)
> This is definitely something that can be polyfilled (with different levels of naivety) but requires modifying built-ins which is a no-no.

You can safely modify `Object.prototype` using `Symbol`.

```js
export const tap = Symbol('tap');

Object.prototype[tap] = function tap(f) {
  f(this);
  return this;
}

[1, 2, 3]
  .map(n => n * 2)
  [tap](console.log.bind(console))
  .reduce((a, b) => a + b);
```

No need to add a new method to `Array.prototype` and you can use it with
any type.