Array.prototype.includesAll

Bob Myers rtm at gol.com
Tue Jun 14 19:58:02 UTC 2016


This proposal is so far from something that should go into the base
language that it makes me choke.

Are you also going to propose that we add `includesNone` and `includesSome`?
Do you want to include an option to sort the items for efficiency?
Why do you provide no `fromIndex` parameter?
Shall we include an option to lowercase before checking for equality?
How does this relate to the notion of array difference, which is one way to
accomplish what you want?

Just write a library that does what you want and get on with your life.

--
Bob

On Wed, Jun 15, 2016 at 1:02 AM, Oriol Bugzilla <oriol-bugzilla at hotmail.com>
wrote:

> > There are no items in `[]` so that doesn't seem like a true statement to
> me.
>
> It's true by [Vacuous_truth](https://en.wikipedia.org/wiki/Vacuous_truth).
>
> > So, at least consistency pulls towards `false`.
>
> You are misunderstanding what `includes` does when there is no argument.
>
> ```js
> [1].includes(); // false
> [void 0].includes(); // true
> ```
>
> Consistency with `every` pulls towards `true`.
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20160615/9fadb8a1/attachment.html>


More information about the es-discuss mailing list