napi_get_array_length

Function napi_get_array_length 

Source
pub unsafe extern "C" fn napi_get_array_length(
    env: napi_env,
    value: napi_value,
    result: *mut u32,
) -> napi_status
Available on crate feature napi only.
Expand description

Obtains the array length.

§Arguments

  • env - Current running virtual machine context.

  • value - The napi_value representing the ArkTS Array being queried.

  • result - The length of the array.

§Returns

  • Returns the function execution status. [napi_ok] If the function executed successfully.

[napi_invalid_arg] If the param env, value and(or) result is nullptr;

[napi_pending_exception] There is an uncaught exception occurred before(in) execution.

Available since API-level: 10