What is the output?
Anonymous Quiz
18%
1024 4 -4 bigint true
37%
1024 3 -3 bigint true
24%
1024 3 -3 bigint false
21%
1024n 3n -3n bigint true
👍3❤2
CHALLENGE
const obj = { a: { b: null, getC: () => 42 } };
let calls = 0;
function sideEffect() {
calls++;
return 10;
}
const result = obj.a?.b?.getC?.() ?? sideEffect();
const result2 = obj.a?.z?.getC?.() ?? sideEffect();
console.log(result, result2, calls);👍2🔥2❤1
What is the output?
Anonymous Quiz
23%
undefined 10 2
18%
10 10 1
32%
undefined undefined 2
27%
10 10 2
🤔2❤1🔥1
CHALLENGE
const counter = {
count: 0,
*[Symbol.iterator]() {
yield this.count++;
yield this.count++;
yield this.count++;
}
};
console.log([...counter], counter.count);
export {};🤔1
What is the output?
Anonymous Quiz
20%
[ 0, 1, 2 ] 2
39%
[ 0, 1, 2 ] 0
28%
[ 0, 1, 2 ] 3
13%
[ 1, 2, 3 ] 3
❤1