Multiple choice technology web technology

HTML: javascript: alert(parseInt(name.value,10)); What is The Output When The User Enters 0XAB in the text field ?

  1. Nan

  2. ab

  3. 0

  4. Error

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

parseInt() with radix 10 forces decimal interpretation. '0XAB' is not a valid decimal string, so parseInt() parses until it finds an invalid character at position 0 and returns 0. The 0X prefix is not valid in base 10.