Capy-Bearer Documentation

Delete a child

lib call

Capy

function delete(value : any, key : string) any

Description

delete(value, key) removes key from value. A missing key leaves the value unchanged.

Parameters

value : target value

key : child key

Return Values

The changed target value.

Example

Capy

var user := {"name": "Ada", "role": "admin"}
user = delete(user, "role")
print(has(user, "role"), "\n")

Output

false