This article covers features introduced in SpiderMonkey 24

Assign undefined to all of the object's non-reserved slots.

Note: This is done for all slots, regardless of the associated property descriptor.


JS_SetAllNonReservedSlotsToUndefined(JSContext *cx, JSObject *objArg);
Name Type Description
cx JSContext * The context in which to clear the object. Requires request. In a JS_THREADSAFE build, the caller must be in a request on this JSContext.
obj JSObject * Object from which to delete all properties.


JS_SetAllNonReservedSlotsToUndefined assignes undefined to all of obj's own properties, except the special __proto__ and __parent__ properties, in a single operation. Properties belonging to objects on obj's prototype chain are not affected.

See Also

Document Tags and Contributors

 Contributors to this page: evilpie, arai, fscholz, tschneidereit
 Last updated by: evilpie,