# array chunk `chunk(array, size)`,將陣列拆分成多個 size 長度的塊,並組成一個新陣列。如果陣列無法被分割成全部等長的塊,最後剩下的元素將組成一個區塊。 ``` // example chunk(['a', 'b', 'c', 'd'], 2); // => [['a', 'b'], ['c', 'd']] chunk(['a', 'b', 'c', 'd'], 3); // => [['a', 'b', 'c'], ['d']] ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up