Home / Javascript Tips Generated By ChatGPT / Checking for Array Membership in Javascript Use .includes() to check if an array contains a certain element. Source Code let pets = ['dog', 'cat', 'rabbit']; console.log(pets.includes('cat')); // true