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
{
  "id": "fn-array-prop",
  "dataComponent": "array",
  "heading": {
    "title": "prop",
    "badges": ["Array", "PARTIAL"]
  },
  "synopsis": "Retrieves the value of a specified key from a keyed array. Supports partial usage and placeholders for the key or the object (or both).",
  "codeBlocks": [
    "extend(\"array\")\\n\\nkeyedExample = [ name:\"Alice\", city:\"Paris\" ]\\n\\nsput( array:prop(\"name\", keyedExample) )\\n// => \"Alice\"\\n\\n# Partial usage => known key, missing object\\ngetCity = array:prop(\"city\")\\nsput( getCity(keyedExample) )\\n// => \"Paris\"\\n\\n# Placeholder => known object, missing key\\ngetSomething = array:prop(_, keyedExample)\\nsput( getSomething(\"name\") )\\n// => \"Alice\""
  ],
  "notes": [
    "If both a key (string) and a keyed array are provided, the value for that key is returned immediately.",
    "If only one of them is provided, returns a partial function that expects the missing argument.",
    "Raises an error if the object is not a keyed array or if the key is not a valid single string."
  ]
}