Array.prototype.contains solutions

John-David Dalton john.david.dalton at gmail.com
Tue Sep 30 17:12:34 PDT 2014


A more general solution seems like a good idea.
Renaming doesn't really solve the deeper issue.
Extending native prototypes is a JavaScript "thing" and something that will
most likely continue continue.

Ember adds methods to Array.prototype and Function.prototype by default:
http://emberjs.com/api/classes/Ember.Array.html#method_contains (btw their
Array#contains is not ES7 spec compliant either)

then there's the oldie Prototype.js:
http://api.prototypejs.org/

and alternatives like Sugar.js:
http://sugarjs.com/api

that's a lot to watch out for.

JDD


On Tue, Sep 30, 2014 at 5:03 PM, Domenic Denicola <
domenic at domenicdenicola.com> wrote:

> From: es-discuss [mailto:es-discuss-bounces at mozilla.org] On Behalf Of
> Domenic Denicola
>
> > Or you could attack the problem at the for-in level
>
> This half-sentence was a leftover from an earlier pass; please ignore it.
>
> _______________________________________________
> 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/20140930/ef7a44ae/attachment-0001.html>


More information about the es-discuss mailing list