1.

What will happen if the radix parameter of the parseInt() function is omitted?(a) Runs in assumption(b) Throws exception(c) Aborts(d) Taken as 0The question was asked during an interview.This is a very interesting question from Parsing Values using JavaScript topic in section Parsing, Benchmarking and Logging of JavaScript

Answer»

Correct ANSWER is (a) Runs in assumption

Easy explanation: The PRINT() method opens the Print Dialog Box, which lets the user to select preferred printing options.

If the string begins with “0x”, the radix is 16 (hexadecimal)

If the string begins with “0”, the radix is 8 (octal). This feature is deprecated

If the string begins with any other value, the radix is 10 (decimal)



Discussion

No Comment Found

Related InterviewSolutions