parseInt Number JavaScript JS

The JavaScript number parseInt() method is used to convert a string into an Integer number.

Syntax:

Number.parseInt(string, radix) 

Parameters
string: It represents the string which have to be converted into integer number. It is required parameter.
radix: It represents the number format. It is optional parameter.

Returns
Integer number.

Example

<!DOCTYPE html>
<html>
<body>
<script>  
document.writeln(Number.parseInt("50.5FIVE"));  
</script>  
</body>
</html>

Output

50
Please Share