QuestenaPractice that shows what to review next
Question 112

Without any explicit conversion, what happens when JavaScript evaluates 1n + 1?

  1. It returns the Number 2
  2. It returns the BigInt 2n
  3. It returns NaN
  4. It throws a TypeErrorCorrect answer

Explanation

The addition mixes a BigInt operand with a Number operand, and direct arithmetic between those numeric types throws a TypeError. It does not silently convert both operands; an explicit conversion would be needed to make their numeric types agree.

Continue with this test

Start practice
Question 112: Without any explicit conversion, what happens when… · JavaScript Fundamentals · Questena