QuestenaUn entraînement qui indique quoi revoir ensuite
Question 9

Which statements describe direct arithmetic between a BigInt and a Number? Select all that apply.

  1. The Number is always converted to BigInt automatically
  2. 1n + 1 throws a TypeErrorBonne réponse
  3. Every comparison between BigInt and Number throws
  4. 2n * 3 throws a TypeErrorBonne réponse

Explication

Direct use of arithmetic operators such as plus or multiplication with one BigInt and one Number throws a TypeError. Converting one operand first can align the numeric types, while claiming automatic conversion ignores the required type separation.

Continuer avec ce test

Commencer l’entraînement
Question 9: Which statements describe direct arithmetic between a… · JavaScript Fundamentals · Questena