Array.prototype.includesAll

Oriol Bugzilla oriol-bugzilla at hotmail.com
Tue Jun 14 16:59:41 UTC 2016


What's the point of using `reduce` instead of `every`?

```js
Array.prototype.includesAll = function (...args) {
  return args.every(item => this.includes(item));
}
```

I disagree with this test

```js
expect([2, 3].includesAll()).toBe(false)
```

The array `[2,3]` includes all items in `[]`. So it should return `true`. 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20160614/11c619fc/attachment.html>


More information about the es-discuss mailing list