I am faced with a complex array
The array looks like this:
let arr = [[2, "OR", 22, 22, "OR", 22, 20], [300, "OR", 22, 300, "OR", 22, 22, "OR", 1], [1212, 2, "OR", 1]]
My goal is to extract and sum up all the numbers between "OR"
For instance, the modified array should be as follows:
[[2,"OR",44, "OR", 42],[300, "OR", 322, "OR", 42, "OR", 1], [1214, "OR, 1]]
I have been pondering over this for several days now, but haven't found a solution yet.