JSBool JS_GetElement()
Description
This function reads a single element of an array object.
Arguments
JSContext *cx, JSObject *obj, unsigned int index, jsval *v
- The
cxargument is the opaqueJSContextpointer that passes to the JavaScript function. - The
objargument is a pointer to an array object. - The
indexargument is an integer index into the array. The first element is index 0, and the last element is index (length - 1). - The
vargument is a pointer to ajsvalwhere the contents of thejsvalstructure in the array should be copied.
Returns
A Boolean value: JS_TRUE indicates success; JS_FALSE indicates failure.