ES6 集合Set values() 和 keys()


ES6 集合Set values() 和 keys()

var mySet = new Set();
mySet.add("Jim");
mySet.add("Jack");
mySet.add("Jane");
console.log("Printing keys()------------------");  

var keyitr = mySet.keys();
console.log(keyitr.next().value);
console.log(keyitr.next().value);
console.log(keyitr.next().value);  
console.log("Printing values()------------------");

var valitr = mySet.values();
console.log(valitr.next().value);
console.log(valitr.next().value);
console.log(valitr.next().value);