napi_delete_property


napi_status napi_delete_property(napi_env env,
                                 napi_value object,
                                 napi_value key,
                                 bool* result); 
  • [in] env:调用 Node-API 时所处的环境。
  • [in] object:要查询的对象。
  • [in] key:要删除的属性名称。
  • [out] result:属性删除是否成功。可以通过传入 NULL 来忽略 result

如果 API 成功,则返回 napi_ok

【Returns napi_ok if the API succeeded.】

此 API 尝试从 object 中删除 key 自有属性。

【This API attempts to delete the key own property from object.】