home/coding/prompt-63

Prompt

GPTClaudeDeepSeek··1,250 copies·updated 2026-07-14
prompt-63.prompt
Write a JavaScript function `chunk(array, size)` that splits `array` into consecutive
sub-arrays of length `size`, with the final chunk holding the remainder.

- `chunk([1,2,3,4,5], 2)` → `[[1,2],[3,4],[5]]`.
- `size` is a positive integer; the original array is not mutated.
- An empty array returns `[]`.

Put it in a single JavaScript code block and `module.exports = chunk` (or
`module.exports = { chunk }`). It will be required from `./solution.js`.

fill the variables

This prompt has 1 variable. Pro fills them into a ready-to-paste prompt for you — no manual find-and-replace.

{chunk}
Unlock with Pro →

when to use it

Community prompt sourced from the open-source GitHub repo Green-PT/honey-for-devs (MIT). A "Prompt" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.

tags

codingcommunitydeveloper

source

Green-PT/honey-for-devs · MIT