SOURCE


//includes


const list = [100, 200, 3, 2, 33, 882, 9098, 92933];


const result = list.reduce((pre, cur) => pre ? pre : cur === 2, false);
console.log(result);


// slice


const slice1 = list.reduce((pre, cur, index) => {
    if (index >= 1 && index < 4) {
        return [...pre, cur];
    }
    return pre;
}, []);


console.log(slice1);
console 命令行工具 X clear

                    
>
console