napi_delete_property
napi_status napi_delete_property(napi_env env,
napi_value object,
napi_value key,
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] key
:要删除的属性的名称。¥
[in] key
: The name of the property to delete. -
[out] result
:属性删除是否成功。result
可以选择性地通过传递NULL
来忽略。¥
[out] result
: Whether the property deletion succeeded or not.result
can optionally be ignored by passingNULL
.
如果 API 成功,则返回 napi_ok
。
¥Returns napi_ok
if the API succeeded.
此 API 尝试从 object
中删除 key
自己的属性。
¥This API attempts to delete the key
own property from object
.