MDN’s new design is in Beta! A sneak peek:

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) {


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

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari
Basic support No support [1] (Yes) Nightly build [2] No support No support 9
Feature Android Chrome for Android Edge Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support No support No support [1] (Yes) No support No support No support No support

[1] See bug 615873 (compatibilty issues).

[2] See bug 1299593 which disables Array.prototype.values outside of Firefox Nightly due to compatibility issues.

See also

Document Tags and Contributors

 Last updated by: concavelenz,