TypedArray.prototype.entries()
Baseline
Widely available
This feature is well established and works across many devices and browser versions. Itâs been available across browsers since 2016ë 9ì.
entries() ë©ìëë í´ë¹ ë°°ì´ì ê° ì¸ë±ì¤ì ëí í¤/ê° ìì í¬í¨íë ìë¡ì´ ë°°ì´ ë°ë³µì ê°ì²´ë¥¼ ë°íí©ëë¤.
ìëí´ ë³´ê¸°
const uint8 = new Uint8Array([10, 20, 30, 40, 50]);
const eArr = uint8.entries();
eArr.next();
eArr.next();
console.log(eArr.next().value);
// Expected output: Array [2, 30]
구문
js
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]
ëª ì¸ì
| Specification |
|---|
| ECMAScript® 2027 Language Specification > # sec-%typedarray%.prototype.entries > |