CHALLENGE
let outerType;
{
function greet() {
return 'inner';
}
outerType = typeof greet;
}
console.log(outerType, typeof greet);
❤3
What is the output?
Anonymous Quiz
25%
function undefined
37%
undefined function
20%
undefined undefined
18%
function function
❤2🔥2
CHALLENGE
const x = 2n ** 10n;
const y = 7n / 2n;
const z = -7n / 2n;
const w = BigInt(3.0) === 3n;
console.log(`${x} ${y} ${z} ${typeof x} ${w}`);
❤5🤔2
What is the output?
Anonymous Quiz
18%
1024 4 -4 bigint true
36%
1024 3 -3 bigint true
24%
1024 3 -3 bigint false
23%
1024n 3n -3n bigint true
👍4❤3🔥1
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);👍3🔥3🤔2❤1
What is the output?
Anonymous Quiz
22%
undefined 10 2
20%
10 10 1
32%
undefined undefined 2
26%
10 10 2
🤔3❤1🔥1
CHALLENGE
const counter = {
count: 0,
*[Symbol.iterator]() {
yield this.count++;
yield this.count++;
yield this.count++;
}
};
console.log([...counter], counter.count);
export {};🤔4🔥1
What is the output?
Anonymous Quiz
18%
[ 0, 1, 2 ] 2
34%
[ 0, 1, 2 ] 0
29%
[ 0, 1, 2 ] 3
18%
[ 1, 2, 3 ] 3
❤3🤔1