Array.prototype.values()

You’re reading the English version of this content since no translation exists yet for this locale. Bu makaleyi çevirmemize yardım edin!

 

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 

Sintaks

arr.values()

Dönüş değeri

Yeni bir Array yineleyici nesne.

Örnekler

for...of loop ile yineleme

var arr = ['e', 'l', 'm', 'a'];
var yineleyici = arr.values();

for (let harf of yineleyici) {
  console.log(harf);
}

Specifications

Specification Status Comment
ECMAScript 2015 (6th Edition, ECMA-262)
The definition of 'Array.prototype.values' in that specification.
Standard Initial definition.
ECMAScript Latest Draft (ECMA-262)
The definition of 'Array.prototype.values' in that specification.
Draft  

Web tarayıcı uyumluluğu

Update compatibility data on GitHub
DesktopMobileServer
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.js
valuesChrome Full support 66Edge Full support 12Firefox Full support 60IE No support NoOpera Full support 53Safari Full support 9WebView Android Full support 66Chrome Android Full support 66Firefox Android Full support 60Opera Android Full support 47Safari iOS Full support 9Samsung Internet Android Full support 9.0nodejs Full support 10.9.0
Full support 10.9.0
Full support 6.5.0
Notes Disabled
Notes The --harmony-array-prototype-values flag is required; the --harmony flag is not sufficient in this case.
Disabled From version 6.5.0: this feature is behind the --harmony-array-prototype-values runtime flag.
No support 0.12 — 4.0.0

Legend

Full support  
Full support
No support  
No support
See implementation notes.
See implementation notes.
User must explicitly enable this feature.
User must explicitly enable this feature.

See also