按数组下标奇数偶数分割数组

es6:

//分隔数组   135   /  246
        funcArray(arr){
            const even = arr.filter((_item, index) => index % 2 === 0);
            const odd = arr.filter((_item, index) => index % 2 !== 0);
        },

 

posted @ 2019-09-04 10:04  大熊丨rapper  阅读(580)  评论(0编辑  收藏  举报