| |||||||||||||||
SummaryRemoves a specified element or numeric property from an object. | |||||||||||||||
SyntaxJSBool JS_DeleteElement2(JSContext *cx, JSObject *obj, const char *name, jsval *rva);
| |||||||||||||||
DescriptionJS_DeleteElement2 removes a specified element, name , from an object, obj , and stores a pointer to the deleted element in rval . If rval is NULL , the element is deleted. If an object references an element belonging to a prototype, the element reference is removed from the object, but the prototype's element is not deleted. If deletion is successful, JS_DeleteElement2 returns JS_TRUE . Otherwise it returns JS_FALSE .
| |||||||||||||||
NotesPer the ECMA standard,JS_DeleteElement2 removes read-only elements from objects as long as those elements are not also permanent.
For JavaScript 1.2 and earlier, if failure occurs because you attempt to delete a permanent element,
To remove all elements and properties from an object, call
| |||||||||||||||
See Also
|