napi_create_reference
functionv1js_native_api.hThis API creates a new reference with the specified reference count to the value passed in.
NAPI_EXTERN napi_status napi_create_reference(napi_env env,
napi_value value,
uint32_t initial_refcount,
napi_ref* result);
[in] env: The environment that the API is invoked under.[in] value: Thenapi_valuefor which a reference is being created.[in] initial_refcount: Initial reference count for the new reference.[out] result:napi_refpointing to the new reference.
Returns napi_ok if the API succeeded.
This API creates a new reference with the specified reference count to the value passed in.