Single Choice Not Set

QWhat does the parseInt() function do in JavaScript?

ID: #4864 Javascript Functions MCQ 324 views
Question Info
#4864Q ID
Not SetDifficulty
Javascript Functions MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A Converts a string to an integer
  • B Converts an integer to a string
  • C Converts a string to a float
  • D None of these
Correct Answer

Explanation

The parseInt() function takes a string as input and returns an integer.
If the string cannot be converted to an integer, the function returns NaN.

Share This Question

Challenge a friend or share with your study group.