klaus

Results 2 comments of klaus

``` let arr1 = ['A1', 'A2', 'A3', 'B1', 'B2', 'C1', 'C2', 'D1', 'D2']; let arr2 = ['A', 'B', 'C', 'D','E']; let newArr1 = []; newArr1 = arr2.map((item)=>{ let arr3 =...

使用Generator实现数组flatten: ```javascript function* flat(arr){ for(let item of arr){ if(Array.isArray(item)){ yield* flat(item);//Generator委托 }else { yield item } } } function flatten(arr) { let result = []; for(let val of(flat(arr))){ result.push(val); }...