»Builtin Function: delete

The built-in function delete deletes an element from a map.

If the element to delete does not exist, the map is left unchanged. Calling delete on a value that is not a map or undefined is an immediate error. The result of delete is always undefined.


data = { "a": 2, "b": 3 }
delete(data, "a")            // data is now { "b": 3 }
delete(data, "c")            // data is unchanged
delete(1, "a")               // error()
delete(undefined, "b")       // error()