entries()
metodu, içerisinde, her bir elemanı için anahtar/değer çifti içeren yeni bir Gezinilebilir Dizi
nesnesi döndürür.
var a = ['a', 'b', 'c'];
var iterator = a.entries();
console.log(iterator.next().value); // [0, 'a']
console.log(iterator.next().value); // [1, 'b']
console.log(iterator.next().value); // [2, 'c']
Söz dizimi
a.entries()
Dönüş değeri
Yeni bir gezinilebilir Array
nesnesi.
Örnekler
Bir for…of döngüsü kullanımı
var a = ['a', 'b', 'c'];
var iterator = a.entries();
for (let e of iterator) {
console.log(e);
}
// [0, 'a']
// [1, 'b']
// [2, 'c']
Tanımlamalar
Tanımlama | Durum | Yorum |
---|---|---|
ECMAScript 2015 (6th Edition, ECMA-262) The definition of 'Array.prototype.entries' in that specification. |
Standard | Initial definition. |
ECMAScript Latest Draft (ECMA-262) The definition of 'Array.prototype.entries' in that specification. |
Draft |
Tarayıcı uyumluluğu
We're converting our compatibility data into a machine-readable JSON format.
This compatibility table still uses the old format,
because we haven't yet converted the data it contains.
Find out how you can help!
Özellik | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Temel destekli | 38 | 28 (28) | No support | 25 | 7.1 |
Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Temel destekli | No support | No support | 28.0 (28) | No support | No support | 8.0 |