Entry: JS_NewArrayObject (Function)
Summary: Creates a new array object.
Syntax:
JSObject * JS_NewArrayObject(JSContext *cx, jsint length,
jsval *vector);
Argument Type Description
cx JSContext * Pointer to a JS context from which to derive runtime information.
length jsint Number of elements to include in the array.
vector jsval * Pointer to the initial values for the array's elements.
Description:
JS_NewArrayObject creates a new array object in the JSRuntime of the specified JSContext, cx. If array creation is successful, JS_NewArrayObject initializes each element identified by index i from 0 to length - 1 to have the value vector[i], and then returns a pointer to the new object. Otherwise JS_NewArrayObject returns NULL.
length specifies the number of elements in the array. If length is 0, JS_NewArrayObject creates an array object of length 0 and ignores vector.
See also:
|
|
|