ES6 - Collections Set Method entries()


Advertisements

Returns a new Iterator object that contains an array of [value,value] for each element in the Set.

Syntax

mySet.entries()

Return Value

Returns a new iterator object.

Example

var mySet = new Set(); 
mySet.add("Jim"); 
mySet.add("Jack"); 
mySet.add("Jane"); 

var itr = mySet.entries() 
console.log(itr.next().value); 
console.log(itr.next().value); 
console.log(itr.next().value); 

Output

Jim,Jim 
Jack,Jack 
Jane,Jane 
es6_collections.htm
Advertisements