![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is the role of parseFloat() method in JavaScript?
Use the parseFloat() method in JavaScript to return a floating point number after parsing a string.
Example
You can try to run the following code to learn how to work with parseFloat() method in JavaScript.
<!DOCTYPE html> <html> <body> <script> var val1 = parseFloat("2"); var val2 = parseFloat("30 minutes"); document.write(val1); document.write("<br>"+val2); </script> </body> </html>
Advertisements