$ ./guess_the_languageProblem Solving — fix the bug
Problem Solving — fix the bug · easy · #226

Which fix removes the bug?

const ids = [4, 8, 15];
if (ids.contains(8)) {
  console.log('found');
}
  1. Call ids.has(8)
  2. Call ids.includes(8)
  3. Write 8 in ids
  4. Call ids.contains?.(8)
Arrays have no contains method; includes is the membership test (has is for Set and Map).
Play Problem Solving ▸