I have two arrays all with unique values and I want to compare them so that I get a list of all the values that consecutive
const array1 = [1a,4a,3h,78h,5b,6b,7h]
const array2 = [3h,1a,4a,5b,6b,7h]
In this case I want to compare any number of consecutively matching values I want a list of all the pairs or any number of consecutively matching unique values they have which then gives me a list like this
const array3 =[[1a,4a],[5b,6b,7h]]
what would be the best way to go about this?
[[1a,4a],[5b,6b]]?[5b,6b,7b]? is this[5b, 6b], [6b, 7b]or ...