the data I get is an array of multiple objects;
I want to divide this array into multiple arrays according to the value of one of the objects;
, for example, according to the value of productId in it, give the value of 1 to 2. 3. My idea is to first iterate through the if to determine the matching values and index values and store the array in the new array;
but I don"t know how to implement it, or if there is any other more concise way.
data is shown in the following figure: