Re: [Proposal] Array.prototype.includes should evaluate object.toString and/or object.valueOf when determining a match

2018-06-20 Thread Andrea Giammarchi
r code to do that with ease, same goes for `find` > or `findIndex`, very appropriate for this use case. > > ```js > items.some(o => o == 'abc'); > ``` > > Regards > > On Wed, Jun 20, 2018 at 8:27 PM, Mike Simon wrote: > >> [Proposal] Array.prototype.includes should evalu

Re: [Proposal] Array.prototype.includes should evaluate object.toString and/or object.valueOf when determining a match

2018-06-20 Thread Mike Simon
priate for this use case. > > ```js > items.some(o => o == 'abc'); > ``` > > Regards > >> On Wed, Jun 20, 2018 at 8:27 PM, Mike Simon wrote: >> [Proposal] Array.prototype.includes should evaluate object.toString and/or >> object.valueOf when determinin

Re: [Proposal] Array.prototype.includes should evaluate object.toString and/or object.valueOf when determining a match

2018-06-20 Thread Andrea Giammarchi
t 8:27 PM, Mike Simon wrote: > [Proposal] Array.prototype.includes should evaluate object.toString > and/or object.valueOf when determining a match > > The problem: > > If I have a list of objects that contain a toString() prototype that > returns a value from the object,

Re: [Proposal] Array.prototype.includes should evaluate object.toString and/or object.valueOf when determining a match

2018-06-20 Thread Peter Jaszkowiak
If you want to check properties or methods of an array of objects, you can use `Array.prototype.some`. On Wed, Jun 20, 2018, 12:27 Mike Simon wrote: > [Proposal] Array.prototype.includes should evaluate object.toString > and/or object.valueOf when determining a match > > The probl

[Proposal] Array.prototype.includes should evaluate object.toString and/or object.valueOf when determining a match

2018-06-20 Thread Mike Simon
[Proposal] Array.prototype.includes should evaluate object.toString and/or object.valueOf when determining a match The problem: If I have a list of objects that contain a toString() prototype that returns a value from the object, Array.prototype.includes does not return true if the value