I'm having trouble figuring this one out. I have an array called answerArray
and I need to see if it matches one of 4 other arrays (Some which are 2d) ex:
var answerArray = [1, 2, 2, 2, 1, 1];
var case1 = [
[1, 2, 3, 1, 1, 1],
[1, 2, 2, 2, 1, 1],
[1, 2, 3, 2, 1, 1],
[1, 2, 2, 1, 1, 1]
];
var case2 = [1, 2, 3, 1, 1, 2];
var case3 = [
[1, 2, 3, 1, 2],
[1, 3, 2, 2, 2]
];
var case4 = [1, 4];
In that example answerArray has a match with case1 because case1 contains [1, 2, 2, 2, 1, 1]
Here is a jsFiddle I did, seems like im close but still cannot get it: http://jsfiddle.net/dH2gx/1/
If you change answerArray to [1,4]
you will see it says "Found Match on case 4"