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