The BigUint64Array.of()
method creates a new typed array from a variable number of arguments.
This method works the same as Array.of()
.
BigUint64Array.of(element0[, element1[, ...[, elementN]]])
Parameter | Optional | Meaning |
---|---|---|
elementN | Required | Elements of which to create the typed array. |
let a = BigUint64Array.of(1n); // BigUint64Array [ 1 ] console.log(a);//from ww w. j a va2s . c o m a = BigUint64Array.of('1', '2', '3'); // BigUint64Array [ 12n, 5n, 8n, 130n, 44n ] console.log(a); a = BigUint64Array.of(12n, 5n, 8n, 130n, 44n); // BigUint64Array [ 12n, 5n, 8n, 130n, 44n ] console.log(a); a = BigUint64Array.of(undefined); // BigUint64Array [ 0 ] console.log(a);