JS: Set.prototype.values
(new in ECMAScript 2015)
Set.prototype.values
mySet.values()-
Return a Generator for the entries.
// call it const xx = (new Set([3, 4, 5])).values(); console.assert( JSON.stringify( Array.from(xx), ) === `[3,4,5]`, ); // is iterable console.assert( Reflect.has(xx, Symbol.iterator), ); // is iterator console.assert( Reflect.has(xx, "next"), );
Set.prototype[Symbol.iterator]
mySet[Symbol.iterator] is the same as mySet.values.
const xx = new Set(); console.assert( xx[Symbol.iterator] === xx.values, );