Javascript BigInt64Array of()

Introduction

The BigInt64Array.of() method creates a new typed array from a variable number of arguments.

This method works the same as Array.of().

BigInt64Array.of(element0[, element1[, ...[, elementN]]])
Parameter Optional Meaning
elementN RequiredElements of which to create the typed array.
let a = BigInt64Array.of(1);            // BigInt64Array [ 1 ]
console.log(a);/*  ww  w  .j a va  2 s.c o m*/
a = BigInt64Array.of('1', '2', '3'); // BigInt64Array [ 1n, 2n, 3n ]
console.log(a);
a = BigInt64Array.of(1n, 2n, 3n);    // BigInt64Array [ 1n, 2n, 3n ]
console.log(a);
a = BigInt64Array.of(undefined);    // BigInt64Array [ 0 ]
console.log(a);



PreviousNext

Related