The values() method returns a new Array Iterator object that contains the values for each index in the array.

var a = ['w', 'y', 'k', 'o', 'p']; 
var iterator = a.values();

console.log(; // w 
console.log(; // y 
console.log(; // k 
console.log(; // o 
console.log(; // p



Return value

A new Array iterator object.


Iteration using for...of loop

var arr = ['w', 'y', 'k', 'o', 'p'];
var iterator = arr.values();

for (let letter of iterator) {

Array.prototype.values is default implementation of Array.prototype[Symbol.iterator].

Array.prototype.values === Array.prototype[Symbol.iterator]      //true

TODO please write about why we need it, usecases.


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.

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support66 Yes60 No539
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support6666 Yes60539 No

1. The --harmony-array-prototype-values flag is required; the --harmony flag is not sufficient in this case.

2. From version 6.5.0: this feature is behind the --harmony-array-prototype-values runtime flag.

See also