Javascript BigUint64Array values()

Introduction

The Javascript BigUint64Array values() method returns an Iterator object for the values in the array.

arr.values()

Iteration using for...of loop

var arr = new BigUint64Array([12n, 5n, 8n, 130n, 44n]);
var eArray = arr.values();

for (let n of eArray) {
  console.log(n);//from  ww w . ja  v  a 2s.c  o  m
}

Alternative iteration

var arr = new BigUint64Array([12n, 5n, 8n, 130n, 44n]);
var eArr = arr.values();
console.log(eArr.next().value); // 10
console.log(eArr.next().value); // 20
console.log(eArr.next().value); // 30
console.log(eArr.next().value); // 40
console.log(eArr.next().value); // 50



PreviousNext

Related