JavaScript-1.5 Reference

JS_GetArrayLength Function

Summary

Retrieves the number of elements in an array object.

Syntax

JSBool JS_GetArrayLength(JSContext *cx, JSObject *obj,
    jsint *lengthp);
NameTypeDescription
cxJSContext *Pointer to the JS context for the object.
objJSObject *Array object for which the number of array elements.
lengthpjsint *Variable in which to report the number of array elements.

Description

JS_GetArrayLength reports the number of elements in an array object, obj. If the number of elements can be determined, JS_GetArrayLength reports the number of elements in lengthp and returns JS_TRUE. Otherwise, it sets lengthp to NULL and returns JS_FALSE.

See Also

Groups [ Function ]
Documents [ LXR ID Search ]
Entries [ JS_AliasElement | JS_DefineElement | JS_DeleteElement | JS_GetElement | JS_IsArrayObject | JS_LookupElement | JS_NewArrayObject | JS_SetArrayLength | JS_SetElement ]

This page was generated by APIDOC