I am dealing with an array like the one below:
var aaa = [
[[value1,value2],[0,0]],
[[value3,value4],[0,1]],
[[value5,value6],[1,0]],
[[value7,value8],[0,2]],
[[value9,value10],[1,1]],
[[value11,value12],[2,0]]
];
Now, I want to split this array into multiple arrays based on specific values such as [0,1]
, [0,2]
, etc.
This means creating new arrays like:
array1 = [[value1,value2],[value3,value4],[value7,value8]];
array2 = [[value5,value6],[value9,value10]];
array3 = [[value11,value12]];
What is the best approach to achieve this?