The thing about `.map` and `.filter` is that it would be easy enough to create 
functional versions:

```js
function* map(array, fn) {
  for (var x of array) {
    yield fn(x)
  }
}
```

But harder to create methods:

```js
Iteratable.prototype.map = function(fn) {
  for (var x of this) {
    yield fn(x)
  }
}
```

The reason being that not all iteratables share a prototype (to my knowledge). 

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to