napi_has_element


napi_status napi_has_element(napi_env env,
                             napi_value object,
                             uint32_t index,
                             bool* result); 
  • [in] env:调用 Node-API 调用的环境。

    ¥[in] env: The environment that the Node-API call is invoked under.

  • [in] object:要查询的对象。

    ¥[in] object: The object to query.

  • [in] index:要检查其存在的属性的索引。

    ¥[in] index: The index of the property whose existence to check.

  • [out] result:该属性是否存在于对象上。

    ¥[out] result: Whether the property exists on the object or not.

如果 API 成功,则返回 napi_ok

¥Returns napi_ok if the API succeeded.

如果传入的 Object 在请求的索引处有一个元素,则此 API 返回。

¥This API returns if the Object passed in has an element at the requested index.