> a.filterMap(f) ~~~ [res for [i,x] of items(a) let (res = f(x, i)) if (res
> !== void 0)]
>
> I rather arbitrarily chose to accept both null and undefined here as way to
> say "no element" -- a reasonable alternative would be to accept *only*
> undefined as "no element".
Oops, I meant to say, I rather arbitrarily chose to accept *only* undefined and
a reasonable alternative would be to accept null *or* undefined, i.e.:
a.filterMap(f) ~~~ [res for [i,x] of items(a) let (res = f(x, i)) if (res
!= null)]
I think I prefer the only-undefined version.
Dave
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss