Does an array contain a specific item? [duplicate]

What about something like this?

const arr = [1,2,3];
const el = 2;
console.log(arr.includes(el)) // true

Leave a Comment