Engine-Level Behaviour — Series 2

Preview — 3 of 10 questions

What is the output?

javascript
const obj = {};
obj.b = 1;
obj[2] = 'two';
obj.a = 3;
obj[1] = 'one';

console.log(Object.keys(obj));
A["a", "b", "1", "2"]
B["b", "2", "a", "1"]
C["1", "2", "b", "a"]
D["2", "1", "b", "a"]

What is the output?

javascript
const str = 'hello';
str.customProp = 'test';

console.log(str.customProp);
console.log(typeof str);
A"test", "string"
B"test", "object"
Cundefined, "object"
Dundefined, "string"

What is the output?

javascript
function factorial(n, acc = 1) {
  if (n <= 1) return acc;
  return factorial(n - 1, n * acc);
}

try {
  console.log(factorial(100000));
} catch (e) {
  console.log(e instanceof RangeError);
}
AThe full, correctly computed factorial of 100000 — a very large number.
Btrue
Cfalse
DInfinity

Sign up free to play

Answer all 10 questions (7 more), see explanations for every answer, and track your score.