Just one thought ...
```js
Object.defineProperty(Array.prototype, "append", {
    value(...sources) {
        this.push(...[...sources]);
        return this;
    },
    writable: true,
    configurable: true
});
```

... but also another one ...
```js
(array.push(...sources), array)
```

it seems to little of an improvement to become new Array method, I am
already confused with includes and contains that append and push, when Sets
have add, might cause me unnecessary headaches.

Regards



On Wed, May 23, 2018 at 10:14 PM, Tab Atkins Jr. <jackalm...@gmail.com>
wrote:

> On Wed, May 23, 2018 at 1:05 PM, Jordan Harband <ljh...@gmail.com> wrote:
> > `array.push(...sources)`, not sure why we'd need "append".
>
> From the original email (a bit buried and hard to find due to broken
> threading, admittedly):
>
> > Has anyone ever suggested Array.prototype.append as an
> Array.prototype.push which returns the array itself?
>
> The point is x.append(y) returning x, whereas x.push(y) returns y.
>
> ~TJ
> _______________________________________________
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to