阿西河

所有教程

公众号
🌙
阿西河前端的公众号

我的收藏

    最近访问  (文章)

      教程列表

      抓包专区
      测试专区

      Node.js N-API napi_create_array_with_length

      Node.js N-API napi_create_array_with_length

      新增于: v8.0.0 N-API version: 1

      napi_status napi_create_array_with_length(napi_env env, size_t length, napi_value* result) [in] env: The environment that the API is invoked under. [in] length: The initial length of the Array. [out] result: A napi_value representing a JavaScript Array. Returns napi_ok if the API succeeded.

      This API returns an N-API value corresponding to a JavaScript Array type. The Array’s length property is set to the passed-in length parameter. However, the underlying buffer is not guaranteed to be pre-allocated by the VM when the array is created - that behavior is left to the underlying VM implementation. If the buffer must be a contiguous block of memory that can be directly read and/or written via C, consider using napi_create_external_arraybuffer.

      JavaScript arrays are described in Section 22.1 of the ECMAScript Language Specification.


      更多内容请参考:Node.js N-API,或者通过 点击对应菜单 进行查看;


      目录
      本文目录
      目录