new Set([1, 2, 3]).values().forEach((v) => console.log(v));
// Logs:
// 1
// 2
// 3Iterator.prototype.forEach() / notebook
Iterator.prototype.forEach()
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
for (const v of new Set([1, 2, 3]).values()) {
console.log(v);
}