Obsolete since JSAPI 39
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.
Remove a specified numeric property from an object.
JS_DeleteElement in JSAPI 39
bool JS_DeleteElement2(JSContext *cx, JS::HandleObject obj, uint32_t index, bool *succeeded);
||The context in which to delete the property. Requires request. In a
||The object from which to delete the property.|
||Index of the property to delete.|
||Out parameter. On success,
JS_DeleteElement2 removes a specified numeric property,
index, from an object,
obj inherits the specified property from a prototype, the property is removed from the object, but not from the prototype. If deletion is successful,
*succeeded and returns
true. Otherwise it returns
false and the value of
*succeeded is undefined.
Per the ECMA standard,
JS_DeleteElement2 removes read-only properties from objects as long as they are not also
JS_DeleteElement2 reports the error and returns
*succeeded will receive the stored value of the property that was not deleted.
To remove all properties from an object, call