The entries() method returns a new Iterator object that contains an array of [value, value] for each element in the Set object, in insertion order. For Set objects there is no key like in Map objects. However, to keep the API similar to the Map object, each entry has the same value for its key and value here, so that an array [value, value] is returned.



Return value

A new Iterator object that contains an array of [value, value] for each element in the given Set, in insertion order.


Using entries()

var mySet = new Set();

var setIter = mySet.entries();

console.log(; // ["foobar", "foobar"]
console.log(; // [1, 1]
console.log(; // ["baz", "baz"]


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

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.js
Basic supportChrome Full support 38Edge Full support 12Firefox Full support 24IE No support NoOpera Full support 25Safari Full support 8WebView Android Full support 38Chrome Android Full support 38Edge Mobile Full support 12Firefox Android Full support 24Opera Android Full support 25Safari iOS Full support 8Samsung Internet Android Full support Yesnodejs Full support 0.12


Full support  
Full support
No support  
No support

See also

Document Tags and Contributors

Contributors to this page: wbamberg, fscholz, jameshkramer, nmve, kdex, eduardoboucas, arai, realityking
Last updated by: wbamberg,