Dear Friends, Today we are going to discuss about the following topics. 1. What is meant by parseInt, when it will be used? 2. What is meant by parseFloat, when in will be used? Whenever we are capturing any number value in HTML forms, by default it will be number. So to do any mathematical it needs to be converted. With can convert any string in to number with parseInt(), which is an inbuilt JavaScript method. But, this parseInt() Method will be used if we are dealing with integer values only. Since it won’t recognize the Floating values like 10.73, 11.77, 3.44… In such cases we use parseFloat() Method. Let me explain this with an Example as follows. Lest us create simple HTML form like follows. In this Example we will be having 3 input fields. First two input fields will be firstNumber and lastNumber respectively. Once user enter first number and second number and click ...
Angular, React, JavaScript, Java, PHP, SQL, C#, Vue, NodeJs, TypeScript and Interview Questions Answers