MDN wants to talk to developers like you: https://qsurvey.mozilla.com/s3/8d22564490d8

JS_GetArrayPrototype

This article covers features introduced in SpiderMonkey 24

Retrieves the original, canonical Array.prototype for an object's global object.

Syntax

JSObject *
JS_GetArrayPrototype(JSContext *cx, JS::HandleObject forObj);
Name Type Description
cx JSContext * Pointer to a JavaScript context from which to derive runtime information. Requires request. In a JS_THREADSAFE build, the caller must be in a request on this JSContext.
forObj JS::HandleObject An object from the global whose Array.prototype is being retrieved.

Description

JS_GetArrayPrototype() retrieves the original Array.prototype of a specified object, obj.  If an error occurs, it returns NULL.

Note: This expression might have different values over time if the global Array property is modified, but this method returns only the original value.

See Also

Document Tags and Contributors

 Contributors to this page: arai, fscholz, Bzbarsky
 Last updated by: arai,