Eric Elliott (2014-03-05T08:24:34.000Z)
What ever happened to Array.prototype.contains? There's an old strawman for
Array.prototype.has (
http://wiki.ecmascript.org/doku.php?id=strawman:array.prototype.has ) that
references this thread: (
https://mail.mozilla.org/pipermail/es-discuss/2012-February/020745.html )

But it seems the thread fizzled out a couple years ago, and
Array.prototype.contains didn't seem to make its way into ES6. That seems
odd, since we do have String.prototype.contains, and it seemed like it was
desirable for DOM. It's also a standard utility function in several
libraries.

Was it left out on purpose? If so, what was the justification?

I predict code like this without it:

''.contains.call([1, 2, 3], 2);  // true

- Eric

Author, "Programming JavaScript Applications" (O'Reilly)
http://ericleads.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140305/79fad622/attachment.html>
domenic at domenicdenicola.com (2014-03-20T16:05:10.548Z)
What ever happened to Array.prototype.contains? There's an old strawman for
[Array.prototype.has](http://wiki.ecmascript.org/doku.php?id=strawman:array.prototype.has) that
references this thread: https://mail.mozilla.org/pipermail/es-discuss/2012-February/020745.html

But it seems the thread fizzled out a couple years ago, and
Array.prototype.contains didn't seem to make its way into ES6. That seems
odd, since we do have String.prototype.contains, and it seemed like it was
desirable for DOM. It's also a standard utility function in several
libraries.

Was it left out on purpose? If so, what was the justification?

I predict code like this without it:

```js
''.contains.call([1, 2, 3], 2);  // true
```