Skip to content
napi-bindings

Search

Search pages, projects and the Node-API reference

Browse Node-APIshow

napi_create_symbol

functionv1js_native_api.h

This API creates a JavaScript symbol value from a UTF8-encoded C string.

napi_status napi_create_symbol(napi_env env,
                               napi_value description,
                               napi_value* result)
  • [in] env: The environment that the API is invoked under.
  • [in] description: Optional napi_value which refers to a JavaScript string to be set as the description for the symbol.
  • [out] result: A napi_value representing a JavaScript symbol.

Returns napi_ok if the API succeeded.

This API creates a JavaScript symbol value from a UTF8-encoded C string.

The JavaScript symbol type is described in Section symbol type of the ECMAScript Language Specification.

View in the official Node.js documentation