Guest practice: this set is not saved and does not count.
What does this log?
const word = "code"; const [first, second] = word; console.log(first, second, [...word].length);
function isIterable(x) { return x != null && typeof x[Symbol.iterator] === "function"; } console.log(isIterable([1]), isIterable({ a: 1 }), isIterable(new Map()), isIterable(null));
function* steps() { console.log("start"); yield "A"; console.log("end"); } const g = steps(); console.log("created"); console.log(g.next().value);
start
created
A
end
function* abc() { yield "a"; yield "b"; return "c"; } const g = abc(); g.next(); g.next(); console.log(g.next(), g.next());
function* nums() { let n = 1; while (true) { yield n++; } } const out = []; for (const x of nums()) { if (x > 3) break; out.push(x); } console.log(out);
Click a question to go back and check it. After you submit, you will see the right answer and an explanation for every question. As a guest, nothing is saved.
Check my answers