function f() {
for (const letter of arguments) {
console.log(letter);
}
}
f("w", "y", "k", "o", "p");arguments[Symbol.iterator]() / notebook
arguments[Symbol.iterator]()
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
function f() {
const argsIter = arguments[Symbol.iterator]();
console.log(argsIter.next().value); // w
console.log(argsIter.next().value); // y
console.log(argsIter.next().value); // k
console.log(argsIter.next().value); // o
console.log(argsIter.next().value); // p
}
f("w", "y", "k", "o", "p");