JS 生成商品sku(JS generate goods SKU)

let arr = [
                [{
                    name: '红色',
                    value: '1'
                }, {
                    name: '黑色',
                    value: '2'
                }],
                [{
                    name: 'X',
                    value: '1'
                }, {
                    name: 'M',
                    value: '2'
                }],
                [{
                    name: '款式A',
                    value: '1'
                }, {
                    name: '款式B',
                    value: '2'
                }]
            ]
            let list = arr.reduce((a, b) => {
                    console.log(a,b)
                var ret = [];
                a.forEach(function(a) {
                    b.forEach(function(b) {
                        ret.push(a.concat([b]));
                    });
                })
                console.log(ret,'===============')
                return ret;
            }, [
                []
            ])
            console.log(list);
————————
let arr = [
                [{
                    name: '红色',
                    value: '1'
                }, {
                    name: '黑色',
                    value: '2'
                }],
                [{
                    name: 'X',
                    value: '1'
                }, {
                    name: 'M',
                    value: '2'
                }],
                [{
                    name: '款式A',
                    value: '1'
                }, {
                    name: '款式B',
                    value: '2'
                }]
            ]
            let list = arr.reduce((a, b) => {
                    console.log(a,b)
                var ret = [];
                a.forEach(function(a) {
                    b.forEach(function(b) {
                        ret.push(a.concat([b]));
                    });
                })
                console.log(ret,'===============')
                return ret;
            }, [
                []
            ])
            console.log(list);