[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/entries [Back]  [Original]

TypedArray.prototype.entries() - JavaScript | MDN

MDN Web Docs

View in English Always switch to English

TypedArray.prototype.entries()

Baseline

20169

entries() TypedArray Array.prototype.entries()

const uint8 = new Uint8Array([10, 20, 30, 40, 50]);
const eArr = uint8.entries();

eArr.next();
eArr.next();

console.log(eArr.next().value);
// : Array [2, 30]

js
entries()

Array.prototype.entries()

for...of

js
const array = new Uint8Array([10, 20, 30, 40, 50]);
const arrayEntries = arr.entries();
for (const element of arrayEntries) {
  console.log(element);
}

js
const array = new Uint8Array([10, 20, 30, 40, 50]);
const arrayEntries = arr.entries();

console.log(arrayEntries.next().value); // [0, 10]
console.log(arrayEntries.next().value); // [1, 20]
console.log(arrayEntries.next().value); // [2, 30]
console.log(arrayEntries.next().value); // [3, 40]
console.log(arrayEntries.next().value); // [4, 50]

ECMAScript 2027 LanguageSpecification
# sec-%typedarray%.prototype.entries


Web Proxy Viewer  |  New URL  |  Original Page