Hi Tobie, Makes sense for sets, where there's no difference between keys and values. For maps, I'd expect "contains" to test values, not keys.
On Sun, May 20, 2012 at 2:46 AM, Tobie Langel <[email protected]>wrote: > Hi, > > The lack of consistency between the naming of > `String.prototype.contains` and `(Set|Map).prototype.has` bothers me > (a little). > > Both Ruby and Python display consistency for this (through the > `include?` instance method and `in` operator respectively). > > Maybe that's been discussed on the list already (can't find a search > function for the archives, unfortunately). > > If not, may I suggest both methods should be named the same? > > And for extra consistency, an Array.prototype.(contains|has) would > also be a nice addition. > > Thanks for your time, > > --tobie > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss > -- Cheers, --MarkM
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

