Contents

deleteProperty(_:)

Deletes the named property from the JavaScript object value.

Declaration

func deleteProperty(_ property: Any!) -> Bool
func deleteProperty(_ property: String!) -> Bool

Parameters

  • property:

    The name of a property in the JavaScript object value.

Return Value

true if property deletion was successful; otherwise, false.

Discussion

Calling this method is equivalent to using the JavaScript delete operator on an object (for example, delete object.property). After deletion, attempting to retrieve the property’s value results in the undefined value, and any descriptor information that defines the property’s behavior (see the defineProperty(_:descriptor:) method or the JavaScript defineProperty function) is lost.

See Also

Working with Container Values