1.

What is the function of the parseInt() method?(a) Parses a data type and stores in an integer(b) Parses a string and returns an integer(c) Parses an integer and returns a string(d) Parses a string and return an objectThis question was posed to me in semester exam.I want to ask this question from Parsing Values using JavaScript in division Parsing, Benchmarking and Logging of JavaScript

Answer»

The correct option is (B) Parses a string and returns an INTEGER

Easiest explanation: The function parseInt() method parses a string and returns an integer. If the string begins with 0x, then the radix value will be 16. If the string begins with “0”, the radix is 8 (octal).



Discussion

No Comment Found

Related InterviewSolutions