napi_create_object


napi_status napi_create_object(napi_env env, napi_value* result) 
  • [in] env:调用该 API 时所处的环境。
  • [out] result:一个表示 JavaScript Objectnapi_value

如果 API 成功,则返回 napi_ok

【Returns napi_ok if the API succeeded.】

此 API 分配一个默认的 JavaScript Object。它等同于在 JavaScript 中执行 new Object()

【This API allocates a default JavaScript Object. It is the equivalent of doing new Object() in JavaScript.】

JavaScript 的 Object 类型在 ECMAScript 语言规范的 区段对象类型 中有描述。

【The JavaScript Object type is described in Section object type of the ECMAScript Language Specification.】