I need a help with this code. I want to check if array matches to one of the combos (array should contain 3 numbers which one of the combos has). If matches should return true
.
I tried to write code using indexOf
and includes
but I couldn't write it correctly. Can you please help me?
const arr1 = [2,3,5,8,1]// comparing should return true, matches combos[6]
const arr2 = [3,1,4] // comparing should return false
const arr3 = [1,2,4,3] // comparing should return true ,matches combo[0]
const arr4 = [9,7,8] // comparing should return true, matches combo[2]
const combos = [[1,2,3],[4,5,6],[7,8,9],[1,5,9],[3,5,7],[1,4,7],[2,5,8],[3,6,9]]