Q. How to convert a string to an integer in JavaScript?

  • (A) parseInt(str)
  • (B) Number(str)
  • (C) +str
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the above
Explanation: All mentioned methods can convert string to number.
Explanation by: Chandani
All mentioned methods can convert string to number.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
109
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Chandani
Publisher
πŸ“ˆ
82%
Success Rate