Javascript BigInt64Array [@@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 BigInt64Array([10n, 20n, 30n, 40n, 50n]);
for (let n of arr) {
  console.log(n);//  ww w  . j  av  a 2  s  . c om
}

Alternative iteration

var arr = new BigInt64Array([10n, 20n, 30n, 40n, 50n]);
var eArr = arr[Symbol.iterator]();
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