Javascript BigUint64Array [@@iterator]()

Introduction

The initial value of the @@iterator property is the same as the initial value of the values() property.

arr[Symbol.iterator]()

Iteration using for...of loop

var arr = new BigUint64Array([12n, 5n, 8n, 130n, 44n]);
for (let n of arr) {
  console.log(n);//from ww  w.  j ava  2  s .  co  m
}

Alternative iteration

var arr = new BigUint64Array([12n, 5n, 8n, 130n, 44n]);
var eArr = arr[Symbol.iterator]();
console.log(eArr.next().value);/* www  . ja va  2s  .  c  om*/
console.log(eArr.next().value); 
console.log(eArr.next().value); 
console.log(eArr.next().value); 
console.log(eArr.next().value); 



PreviousNext

Related