arr.reduce((pre, cur)=> [].concat.apply([], pre.map(t => cur.map(g => t + g))));