What is the output?
Anonymous Quiz
34%
35 [ 20, <1 empty item>, 40, NaN, 60 ]
29%
35 [ 20, 0, 40, NaN, 60 ]
13%
35 [ NaN, 20, 40, 60 ]
23%
35 [ 20, undefined, 40, NaN, 60 ]
CHALLENGE
let i = 0;
const key = () => `k${i++}`;
const obj = {
[key()]: i,
[key()]: i,
[key()]: i,
};
console.log(Object.keys(obj).join(','), obj.k0, obj.k1, obj.k2);
❤3
What is the output?
Anonymous Quiz
25%
k0,k1,k2 0 1 2
27%
k0,k1,k2 1 1 1
33%
k1,k2,k3 1 2 3
15%
k0,k1,k2 1 2 3
❤6
CHALLENGE
const a = 5 & 3;
const b = 5 | 2;
const c = ~5;
const d = 1 << 31;
const e = -1 >>> 28;
const f = 5 ^ 5;
console.log(a, b, c, d, e, f);
What is the output?
Anonymous Quiz
20%
1 7 -6 2147483648 15 0
34%
1 7 -6 -2147483648 15 5
33%
1 7 -6 -2147483648 15 0
13%
1 7 -5 -2147483648 15 0
❤3🤔3
CHALLENGE
'use strict';
function getValue() {
return this.value;
}
const obj = { value: 42, getValue };
const fn = obj.getValue;
try {
fn();
} catch (err) {
console.log(err.constructor.name, typeof this);
}
❤2
What is the output?
Anonymous Quiz
32%
ReferenceError undefined
25%
TypeError undefined
27%
undefined undefined
16%
TypeError object
❤3
CHALLENGE
console.log(
typeof typeof 1,
1 + typeof 1,
2 ** 3 ** 2,
1 + 2 + '3',
1 < 2 < 3,
3 > 2 > 1
);
🔥1
What is the output?
Anonymous Quiz
32%
string 1number 512 33 true true
29%
string number1 512 33 true false
28%
string 1number 512 33 true false
11%
number number 512 33 true true
❤2
CHALLENGE
function Foo(x) {
this.x = x;
return { x: x * 2 };
}
function Bar(x) {
this.x = x;
return 42;
}
const f = new Foo(5);
const b = new Bar(5);
console.log(f.x, b.x, f instanceof Foo, b instanceof Bar);What is the output?
Anonymous Quiz
14%
5 5 false true
41%
10 5 true true
30%
10 5 false true
16%
10 42 false true