napi_set_element


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

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

  • [in] object:从中设置属性的对象。

    ¥[in] object: The object from which to set the properties.

  • [in] index:要设置的属性的索引。

    ¥[in] index: The index of the property to set.

  • [in] value:属性值。

    ¥[in] value: The property value.

如果 API 成功,则返回 napi_ok

¥Returns napi_ok if the API succeeded.

该 API 在传入的 Object 上设置一个元素。

¥This API sets an element on the Object passed in.