Javascript BigUint64Array fill()

Introduction

The Javascript BigUint64Array fill() method fills values into a typed array.

This method works the same as Array.prototype.fill().

BigUint64Array.fill(value[, start = 0[, end = this.length]])
Parameter Optional Meaning
value Required Value to fill the typed array with.
startOptional.Start index. Defaults to 0.
end Optional.End index (not included). Defaults to this.length.

If start is negative, it is treated as array.length+start.

If end is negative, it is treated as array.length+end.

let a = new BigUint64Array([12n, 5n, 8n, 130n, 44n]).fill(4);     
console.log(a);/* w  ww.j av a  2 s  .  c  o m*/
a = new BigUint64Array([12n, 5n, 8n, 130n, 44n]).fill(4, 1);      
console.log(a);
a = new BigUint64Array([12n, 5n, 8n, 130n, 44n]).fill(4, 1, 2);   
console.log(a);
a = new BigUint64Array([12n, 5n, 8n, 130n, 44n]).fill(4, 1, 1);   
console.log(a);
a = new BigUint64Array([12n, 5n, 8n, 130n, 44n]).fill(4, -3, -2); 
console.log(a);



PreviousNext

Related