napi_get_element

Function napi_get_element 

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

Get the requests element of the given ArkTS Array.

§Arguments

  • env - Current running virtual machine context.

  • object - The ArkTS Array.

  • index - The index of the element to get.

  • result - The value of the element.

§Returns

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

[napi_invalid_arg] If the param env, object and(or) result is nullptr.

[napi_object_expected] If the param object is not an ArkTS Object.

[napi_pending_exception] If have uncaught exception, or exception occurred in execution.

Available since API-level: 10