TypedArray

BigUint64Array

Creates a new BigUint64Array typed array representing an array of 64-bit unsigned BigInt integers

Syntax

JavaScript
new BigUint64Array(length) or new BigUint64Array(buffer, byteOffset?, length?)

Parameters

ParameterTypeDescription
lengthnumber | ArrayBuffer | ArrayLike<bigint>Array length, buffer, or array-like source

Return Value

A new BigUint64Array instance

Examples

Basic Usage
const arr = new BigUint64Array([0n, 18446744073709551615n])
console.log(arr) // BigUint64Array [0n, 18446744073709551615n]
Practical Example
const arr = new BigUint64Array(3)
arr[0] = 2n ** 64n - 1n // max uint64
console.log(arr[0])
Advanced Usage
function sumBigUints(arr: BigUint64Array): bigint {
  let total = 0n
  for (const val of arr) total += val
  return total
}

Understanding BigUint64Array

The BigUint64Array method in JavaScript creates a new BigUint64Array typed array representing an array of 64-bit unsigned BigInt integers. It belongs to the TypedArray object and is one of the most widely used methods for working with typedarray values in modern JavaScript and TypeScript applications.

The method signature is new BigUint64Array(length) or new BigUint64Array(buffer, byteOffset?, length?). It accepts 1 parameter: length. When called, it returns a new biguint64array instance. Understanding when and how to use BigUint64Array() helps you write more expressive, readable code.

Common use cases for BigUint64Array include data transformation, input validation, API response processing, and building reusable utility functions. It works well alongside related methods like bigint64array-constructor, uint32array-constructor, arraybuffer-constructor, enabling you to chain operations together for complex data manipulation pipelines.

Supported in Chrome 67+, Firefox 68+, Safari 15+, Edge 79+, Node.js 10.4+.

Browser Compatibility

Supported in Chrome 67+, Firefox 68+, Safari 15+, Edge 79+, Node.js 10.4+.

Related Methods

More TypedArray Methods

Other methods in the TypedArray object

Related Tools

More TypedArray Methods

Explore JavaScript Methods

Browse our complete reference of 410 JavaScript methods with syntax, examples, and explanations.