napi_get_array_length
napi_status napi_get_array_length(napi_env env,
napi_value value,
uint32_t* result) -
[in] env:调用 API 的环境。¥
[in] env: The environment that the API is invoked under. -
[in] value:napi_value代表查询长度的 JavaScriptArray。¥
[in] value:napi_valuerepresenting the JavaScriptArraywhose length is being queried. -
[out] result:uint32代表数组的长度。¥
[out] result:uint32representing length of the array.
如果 API 成功,则返回 napi_ok。
¥Returns napi_ok if the API succeeded.
此 API 返回数组的长度。
¥This API returns the length of an array.
Array 长度在 ECMAScript 语言规范的 数组实例长度部分 中描述。
¥Array length is described in Section Array instance length of the ECMAScript Language
Specification.