score:2

Accepted answer
const isWinner = (currentIndex) => {
  return pattern.some((singlePattern, index) => {
    if (singlePattern.includes(currentIndex)) {
      const [tempIndex_0, tempIndex_1, tempIndex_2] = singlePattern;

      if (
        value[tempIndex_0] == value[tempIndex_1] &&
        value[tempIndex_1] == value[tempIndex_2]
      ) {
        console.log("finish");
        return true;
      }
    }
    return false;
  });
};

Related Query

More Query from same tag