{
    "$meta": {
        "description": "A `map` is a set of values associated with unique keys. Create a `map` with curly braces; get or set a single value with square brackets. Keys and values may be any type.",
        "example": [
            "x = { \"test\": 123 }",
            "x.foo = 42 // set property foo to 42",
            "print(x.foo) // get value of property foo",
            "print(x + { \"bar\": 2 }) // concatenate two maps"
        ]
    },
    "remove": {
        "description": "Removes an item from the `map` with the provided key. Due to the removal, the `map` will get mutated. If the value is removed successfully, this method will return a `number` with the value one. If the removal fails, the value will be zero. Passing any map-like object, such as a file or computer, will cause an error to be thrown, stopping further script execution.",
        "example": [
            "myMap = { \"answer\": 42, \"bar\": 23, \"foo\": \"moo\" }",
            "myMap.remove(\"answer\")",
            "print(myMap)"
        ]
    },
    "push": {
        "description": "Adds the value 1 to the provided key. This operation will mutate the `map`. The updated `map` will be returned. However, it throws an error if you attempt to push a value into itself or into a map-like object such as a `file`, halting further script execution. If the passed key is `null` an error will be thrown as well.",
        "example": [
            "myMap = { \"answer\": 42, \"bar\": 23, \"foo\": \"moo\" }",
            "myMap.push(\"answer\")",
            "print(myMap.answer)"
        ]
    },
    "pull": {
        "description": "Returns and removes the first item in the `map`. This operation will mutate the `map`. Passing a map-like object such as `file` or `computer` will result in an error, interrupting further script execution. If the `map` is empty, this method will return `null`.",
        "example": [
            "myMap = { \"answer\": 42, \"bar\": 23, \"foo\": \"moo\" }",
            "print(myMap.pull)"
        ]
    },
    "pop": {
        "description": "Returns and removes the first item in the `map`. This operation will mutate the `map`. Passing a map-like object such as `file` or `computer` will result in an error, interrupting further script execution. If the `map` is empty, this method will return `null`.",
        "example": [
            "myMap = { \"answer\": 42, \"bar\": 23, \"foo\": \"moo\" }",
            "print(myMap.pop)"
        ]
    },
    "shuffle": {
        "description": "Shuffles all values in the `map`. This operation will mutate the `map`.",
        "example": [
            "myMap = { \"answer\": 42, \"bar\": 23, \"foo\": \"moo\" }",
            "myMap.shuffle",
            "print(myMap)"
        ]
    },
    "sum": {
        "description": "Returns sum of all values inside the `map`. Any non-numeric values will be considered a zero.",
        "example": [
            "myMap = { \"answer\": 42, \"bar\": 23, \"foo\": \"moo\" }",
            "sum = myMap.sum",
            "print(\"Sum of all items in map: \" + sum)"
        ]
    },
    "hasIndex": {
        "description": "Returns a `number`. If the provided key is available in the `map`, the value will be one. Otherwise, the value will be zero.",
        "example": [
            "myMap = { \"answer\": 42, \"bar\": 23, \"foo\": \"moo\" }",
            "containsIndex = myList.hasIndex(\"answer\")",
            "if containsIndex then",
            "   print(\"Map contains the answer.\")",
            "else",
            "   print(\"Map does not contain the answer.\")",
            "end if"
        ]
    },
    "indexOf": {
        "description": "Returns a value which can be of any type since `map` keys can be of any type. In case the value does not exist inside the `map`, `null` is returned.",
        "example": [
            "myMap = { \"answer\": 42, \"bar\": 23, \"foo\": \"moo\" }",
            "key = myList.indexOf(42)",
            "if key != null then",
            "   print(\"Map contains the answer.\")",
            "else",
            "   print(\"Map does not contain the answer.\")",
            "end if"
        ]
    },
    "indexes": {
        "description": "Returns a `list` containing all available keys. Keys can be of any type.",
        "example": [
            "myMap = { \"answer\": 42, \"bar\": 23, \"foo\": \"moo\" }",
            "for key in myMap.indexes",
            "   print(myMap[key])",
            "end for"
        ]
    },
    "len": {
        "description": "Returns a `number` representing the count of items inside the `map`.",
        "example": [
            "myMap = { \"answer\": 42, \"bar\": 23, \"foo\": \"moo\" }",
            "print(\"myMap contains \" + myMap.len + \" items\")"
        ]
    },
    "values": {
        "description": "Returns a `list` containing all available values within `map`.",
        "example": [
            "myMap = { \"answer\": 42, \"bar\": 23, \"foo\": \"moo\" }",
            "for value in myMap.values",
            "   print(value)",
            "end for"
        ]
    },
    "replace": {
        "description": "Returns updated `map` where each value matching with the provided replace argument gets replaced. This operation will mutate the `map`. In case this method gets used on a map-like object such as `file` this method will throw a runtime error.",
        "example": [
            "myObject = { \"answer\": 45 }",
            "myObject.replace(45, 42)",
            "print(myObject.answer)"
        ]
    }
}
