@Kateryna_Pysmenska - I did a quick Google and came across this (+ there’s a lot of variants of this out there):
const cartesian = (...a) => a.reduce((a, b) => a.flatMap(d => b.map(e => [d, e].flat())));
let result = cartesian([1,2],[10,20],[100,200,300]);
If you can wrangle you colour, size and add-on options into 3 arrays, then the
cartesian function will give you all combinations of the elements within.
I need to do a bit of reading on flatMap and flat, but even without fully understanding these, it definitely does the job.