podzbiór w JS

// This was posted by programmer rimon on 2022-02-10; youtube.com/programmerrimon
var list = [[]];
var numbers = [2,3,6,4];
for(let v of numbers) {
    const l = list.length;
    for(let i=0;i<l;++i) {
        let t = list[i].slice(0);
        t.push(v);
        list.push(t);  
    }
}
Homely Hamerkop