show_all = function combine ([item, ...arr]) { if (arr.length) { const sub = combine(arr); const res = []; sub.forEach(s => item.forEach(i => res.push(`${i},${s}`))) return res } else { return item } }; show_all([ ['白色', '蓝色', '红色'], ['50cm'], ['大', '中', '小'], ['L', 'M', 'S'], ])