DEV Community

Discussion on: JavaScript match values in two arrays

Collapse
 
lexlohr profile image
Alex Lohr

Instead of array1.indexOf(obj) !== -1, you can use array1.includes(obj).

Collapse
 
dailydevtips1 profile image
Chris Bongers

Ah yes, great addition Alex!