Instance Method

deleteProperty:

Deletes the named property from the JavaScript object value.

Declaration

- (BOOL)deleteProperty:(JSValueProperty)property;

Parameters

property

The name of a property in the JavaScript object value.

Return Value

YES if property deletion was successful; otherwise, NO.

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

- defineProperty:descriptor:

Defines a property on the JavaScript object value or modifies a property’s definition.

- hasProperty:

Returns a Boolean value indicating whether the JavaScript value has a defined property with the specified name.

- valueAtIndex:

Returns the value at the specified numeric index in the JavaScript object value.

- setValue:atIndex:

Sets the value at the specified numeric index in the JavaScript object value.

- valueForProperty:

Returns the value of the named property in the JavaScript object value.

- setValue:forProperty:

Sets the value of the named property in the JavaScript object value.