In term of design, what you want is to perform a group by operation and probably then map it to the final datastructure (bike, modelId, color, quantity)
There are several ways to implement the two steps, including using a lib (lodash groupBy for example) or the reduce mentioned in the other comment.