1.

What will be the radix value of the parseInt()method when the string begins with 0?(a) 6(b) 7(c) 8(d) 9The question was asked during an internship interview.My query is from Parsing Values using JavaScript in portion Parsing, Benchmarking and Logging of JavaScript

Answer»

Right answer is (c) 8

To explain: If the string BEGINS with 0x, then the radix VALUE will be 16. If the string begins with “0”, the radix is 8 (OCTAL). This FEATURE is deprecated.



Discussion

No Comment Found

Related InterviewSolutions