mumu 0.10.0

Lava Mumu is a language for those in the now and that know
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
  "id": "fn-array-chunk",
  "dataComponent": "array",
  "heading": {
    "title": "chunk",
    "badges": ["Array", "PARTIAL"]
  },
  "synopsis": "Splits an array into subarrays of a given size. The last chunk may be smaller if not evenly divisible. Partial and placeholder usage supported.",
  "codeBlocks": [
    "extend(\"array\")\n\narr = [1,2,3,4,5]\nsput(array:chunk(2, arr))\n# => [[1,2],[3,4],[5]]\n\n# Partial usage:\nc2 = array:chunk(2)\nsput(c2(arr))\n# => [[1,2],[3,4],[5]]\n\n# Placeholder usage:\npart = array:chunk(_, arr)\nsput(part(3))\n# => [[1,2,3],[4,5]]"
  ],
  "notes": [
    "Takes two arguments: (size, array).",
    "Returns a MixedArray of arrays, each of given chunk size.",
    "Last chunk may be shorter if array length is not divisible.",
    "Partial and placeholder usage supported."
  ]
}