獲取一個數組類型['a','b','c','d','e','f','g'],轉化爲[['a','b'],['c','d'],['e','f','g']]這種類型的

let arr = ["a", "b", "c", "d", "e", "f", "g"]rest const fn = (arr, ...rest) => {console let temp = []co for (let i = 0; i < rest.length; i++) {let temp.push(arr.splice(0, rest[i]))push }return return
相關文章
相關標籤/搜索