--- title: Array.prototype.values() slug: Web/JavaScript/Reference/Global_Objects/Array/values tags: - Dizi yineleyici - Iterator - JavaScript - metod - prototip translation_of: Web/JavaScript/Reference/Global_Objects/Array/values ---
values()
methodu dizideki tüm elemanları içeren yeni bir (Dizi yineleyici)
nesnesi döner
var a = ['e', 'l', 'm', 'a']; var yineleyici = a.values(); console.log(yineleyici.next().value); // e console.log(yineleyici.next().value); // l console.log(yineleyici.next().value); // m console.log(yineleyici.next().value); // a
arr.values()
Yeni bir {{jsxref("Array")}} yineleyici nesne.
for...of
loop ile yinelemevar arr = ['e', 'l', 'm', 'a']; var yineleyici = arr.values(); for (let harf of yineleyici) { console.log(harf); }
Specification | Status | Comment |
---|---|---|
{{SpecName('ES2015', '#sec-array.prototype.values', 'Array.prototype.values')}} | {{Spec2('ES2015')}} | Initial definition. |
{{SpecName('ESDraft', '#sec-array.prototype.values', 'Array.prototype.values')}} | {{Spec2('ESDraft')}} |
{{Compat("javascript.builtins.Array.values")}}