answersLogoWhite

0


Best Answer

it is used to convert the string value that we get from the users to integer data type

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is parseint in javascript?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How to convert a string into an integer in javascript?

In C# you can do that in the following way Convert.ToInt32(yourStringHere), for instance Convert.ToInt32("wikianswers"). But not all string can be converted to int type. If it happens compilator will throw the exception converting error which you can handle using structure try { ...//your code } catch (Exception) { ... //your code in the case of the exception }


What is parseInt in BufferedReader in java?

parseInt() interprets the next available token as an int.


Program to fnd the biggest of 3 numbers in Java script?

Here is the code: <html> <head> <script type="text/javascript" langage="javascript"> function getHighest() { var a = parseInt(document.getElementById("num1").value); var b = parseInt(document.getElementById("num2").value); var c = parseInt(document.getElementById("num3").value); if((a>b)&&(a>c)) { alert(a+" is the highest number"); } else if((b>a)&&(b>c)) { alert(b+ " is the highest number"); } else if((c>a)&&(c>b)) { alert(c+ " is the highest number"); } else { alert("One of them is not an int"); } } </script> </head> <body> Input a: <input type="text" name="number1" id="num1" /><br /> Input b: <input type="text" name="number2" id="num2" /><br/> Input c: <input type="text" name="number3" id="num3" /><br/> Submit: <input type="submit" name="submit" value="submit" onclick="javascript:getHighest();return false;" /> </body> </html>


What is a javascript tutorial?

A JavaScript tutorial contains instructions that will teach you how to code in JavaScript.


What languages can a browser understand?

HTML, CSS, & JavaScript.

Related questions

How do you round the number 7.25 to the nearest integer in javascript?

with parseInt. EX: xxx=7.25; a=parseInt(xxx); alert(a);


How to convert a string into an integer in javascript?

In C# you can do that in the following way Convert.ToInt32(yourStringHere), for instance Convert.ToInt32("wikianswers"). But not all string can be converted to int type. If it happens compilator will throw the exception converting error which you can handle using structure try { ...//your code } catch (Exception) { ... //your code in the case of the exception }


What is parseInt in BufferedReader in java?

parseInt() interprets the next available token as an int.


Why using parseInt in java?

parseInt is a method in the Integer class in java and is used to parse string values into integer numbers. ex: int i = Integer.parseInt("10"); After the above line of code, the variable i will be assigned a value of 10 which is the numeric value of the string passed as argument to the parseInt method


Program to fnd the biggest of 3 numbers in Java script?

Here is the code: <html> <head> <script type="text/javascript" langage="javascript"> function getHighest() { var a = parseInt(document.getElementById("num1").value); var b = parseInt(document.getElementById("num2").value); var c = parseInt(document.getElementById("num3").value); if((a>b)&&(a>c)) { alert(a+" is the highest number"); } else if((b>a)&&(b>c)) { alert(b+ " is the highest number"); } else if((c>a)&&(c>b)) { alert(c+ " is the highest number"); } else { alert("One of them is not an int"); } } </script> </head> <body> Input a: <input type="text" name="number1" id="num1" /><br /> Input b: <input type="text" name="number2" id="num2" /><br/> Input c: <input type="text" name="number3" id="num3" /><br/> Submit: <input type="submit" name="submit" value="submit" onclick="javascript:getHighest();return false;" /> </body> </html>


What is a javascript tutorial?

A JavaScript tutorial contains instructions that will teach you how to code in JavaScript.


What languages can a browser understand?

HTML, CSS, & JavaScript.


What are built-in javascript classes?

Javascript does not have classes


How do you sort in javascript?

Javascript can help in browseing


How old is Javascript?

Javascript was created in 1995.


Program to check whether the given number is an Armstrong number?

<html> <head> <Script Language="JavaScript"> var a,n,b=0,t; n=parseInt(window.prompt("enter n","0")); t=n; while(n>0) { a=n%10; b=b+a*a*a; n=n/10; } if(b==t) { document.writeln("Armstrong no"); } else { document.writeln("Not an Armstrong no"); } </script> </head> </html>


Do you need java compiler to execute HTML programs written in javascript?

No, Java and JavaScript are nothing to do with each other, JavaScript is a form of EMCAScript, not Java. Every modern browser comes with a JavaScript engine that is used to understand JavaScript. so there is no need for it, no.