JS专属求所有子集方法

it2023-09-26  76

const f = arr => ( arr.reduce((prev, next) => [ ...prev, ...prev.map(item => [next, ...item]) ], [[]]) )

 

最新回复(0)