To convert a string to an integer in JavaScript, you can use the _______ function.

  • parseInteger
  • toInteger
  • parseInt
  • convertToInt
The correct option is "parseInt." In JavaScript, the "parseInt" function is used to convert a string to an integer. It parses a string argument and returns an integer of the specified radix (the base in mathematical numeral systems). The other options provided ("parseInteger," "toInteger," and "convertToInt") are not valid JavaScript functions for this purpose.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *