Quantcast
Viewing latest article 10
Browse Latest Browse All 66

Answer by Krishna Ganeriwal for How do I check if an array includes a value in JavaScript?

  1. Either use Array.indexOf(Object).
  2. With ECMA 7 one can use the Array.includes(Object).
  3. With ECMA 6 you can use Array.find(FunctionName) where FunctionName is a user defined function to search for the object in the array.

    Hope this helps!


Viewing latest article 10
Browse Latest Browse All 66

Trending Articles