Array.prototype.contains

Garrett Smith dhtmlkitchen at gmail.com
Thu Jul 24 11:30:23 PDT 2014


On 7/24/14, Andrea Giammarchi <andrea.giammarchi at gmail.com> wrote:
> What is this about? Not an answer nor a solution to what I've said...
> Just think that NaN is rarely an explicit value, rather something
> potentially generated at runtime. Would
> you .some(Number.isNAN.bind(Number)) all the Arrays? I don't think so,
> at least I wouldn't
>

It looked like you were trying to determine if a finite number is in
an array. Is that right? That answer to how to do that would be:

Number.isFinite(v) && arr.indexOf(v) != -1;
-- 
Garrett
@xkit
ChordCycles.com
garretts.github.io


More information about the es-discuss mailing list