Questenaتمرینی که نشان می‌دهد بعد چه چیزی را مرور کنید
سؤال 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 TypeErrorپاسخ درست

توضیح

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.

ادامهٔ این آزمون

شروع تمرین
سؤال 112: Without any explicit conversion, what happens when… · JavaScript Fundamentals · Questena