I think makes sense to have String.prototype.reduce too then.

17.05.2018, 17:16, "Ben Fletcher" <[email protected]>:
> Consider adding the array .map() implementation directly to the String 
> prototype.
>
> Here is a possible polyfill:
>
>     String.prototype.map = function (fn) {
>       return Array.prototype.map
>         .call(this, fn)
>         .join('');
>     }
>
> This replaces the common pattern of splitting, mapping, joining strings for 
> processing.
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to