JSObject *JS_NewArrayObject()
Description
This function creates a new object that contains an array of JSVals.
Arguments
JSContext *cx, unsigned int length, jsval *v
- The
cxargument is the opaqueJSContextpointer that passes to the JavaScript function. - The
lengthargument is the number of elements that the array can hold. - The
vargument is an optional pointer to thejsvalsto be stored in the array. If the return value is notnull,vis an array that containslengthelements. If the return value isnull, the initial content of the array object is undefined and can be set using theJS_SetElement()function.
Returns
A pointer to a new array object or the value null upon failure.