MAP::DELETE 1g 2024-09-24 laplante@plcb.ca GOWEB/MAP


title: “MAP::DELETE” author: “laplante@plcb.ca” date: 2024-09-24 version: “1.0.0” section: “1g”

category: “GOWEB/MAP”

Name

map::delete — Remove one or more keys from a map

Synopsis

map::delete(map[, key…])

Description

The map::delete function removes one or more keys from a map.

This allows for flexible and efficient cleanup of map entries.

Examples

res = {{
    m := { "x": 1, "y": 2, "z": 3 };

    delete(m, "a", "x", "z");  // deletes "x" and "z", ignores "a" since it doesn't exist
    m;

    m = { "x": 1, "y": 2, "z": 3 };
    delete(m, ["a", "x", "z"]);  // deletes "x" and "z" again
    m;
}}.

// Result:
res = {"y":2}{"y":2}

Author

laplante@plcb.ca

See also

Version