1.

What is the purpose of the radix parameter in the parseInt() method?(a) Numeral system not to be used(b) Numeral system to be used(c) Conversion mode(d) Parsing modeI got this question during an interview.I need to ask this question from Parsing Values using JavaScript in portion Parsing, Benchmarking and Logging of JavaScript

Answer»

The correct choice is (b) NUMERAL system to be used

Explanation: FUNCTION parseInt() method parses a string and returns an INTEGER. The radix PARAMETER is used to specify which numeral system to be used, for example, a radix of 16 (hexadecimal) indicates that the NUMBER in the string should be parsed from a hexadecimal number to a decimal number.



Discussion

No Comment Found

Related InterviewSolutions