Array.prototype.includes with multiple arguments

Oriol Bugzilla oriol-bugzilla at
Fri Jun 10 21:00:36 UTC 2016

Array.prototype.includes uses the second argument as the starting index.

Therefore, these calls would be identical, but you want them to behave differently:

["a"].includes("a", 0); // true -- "a" can be found at position 0
["a"].includes(...["a", 0]); // false -- 0 can't be found in the array

So no, it wouldn't work well. Moreover, why every and not e.g. some?

But maybe new methods could be added, like includesEvery and includesSome.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list