Multiple choice technology web technology

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

  1. Nan

  2. 08

  3. 0

  4. 8

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

parseInt() with radix 10 forces decimal interpretation. '08' is a valid decimal string representing 8, so parseInt('08', 10) returns 8. The radix parameter overrides the leading zero octal behavior.