The Float64Array.of()
method creates a new typed array from a variable number of arguments.
This method works the same as Array.of()
.
Float64Array.of(element0[, element1[, ...[, elementN]]])
Parameter | Optional | Meaning |
---|---|---|
elementN | Required | Elements of which to create the typed array. |
let a = Float64Array.of(1); // Float64Array [ 1 ] console.log(a);/*from www. ja v a 2 s.c o m*/ a = Float64Array.of('1', '2', '3'); // Float64Array [ 1, 2, 3 ] console.log(a); a = Float32Array.of(1, 2, 3); // Float32Array [ 1, 2, 3 ] console.log(a); a = Float64Array.of(undefined); // Float64Array [ 0 ] console.log(a);