napi_get_property_names
napi_status napi_get_property_names(napi_env env,
napi_value object,
napi_value* result); [in] env:调用 Node-API 的环境。[in] object:要从中检索属性的对象。[out] result:一个napi_value,表示一个 JavaScript 值的数组,这些值表示对象的属性名称。该 API 可用于使用napi_get_array_length和napi_get_element迭代result。
如果 API 成功,则返回 napi_ok。
🌐 Returns napi_ok if the API succeeded.
此 API 返回 object 的可枚举属性名称,结果为字符串数组。object 中键为符号的属性将不会被包含在内。
🌐 This API returns the names of the enumerable properties of object as an array
of strings. The properties of object whose key is a symbol will not be
included.