Does the `[...oldArr, ...elementsToPushArr]` pattern take care of that for
you? I've always assumed it's much less performant than your form would be,
but I (naively) suppose the implementation could be optimized like anything
else
On Wed, May 23, 2018 at 8:01 AM
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,
2 matches
Mail list logo