Logo

Programming-Idioms

History of Idiom 22 > diff from v88 to v89

Edit summary for version 89 by programming-idioms.org:
[JS] Fix things

Version 88

2019-12-16, 09:05:54

Version 89

2019-12-17, 12:35:24

Idiom #22 Convert string to integer

Extract integer value i from its string representation s (in radix 10)

Illustration

Idiom #22 Convert string to integer

Extract integer value i from its string representation s (in radix 10)

Illustration
Extra Keywords
int base conversion
Extra Keywords
int base conversion
Code
i = parseInt("23", 10)
Code
let i = parseInt(s, 10)
Comments bubble
parseInt(string, radix);
Radix is an integer between 2 and 36 that represents the radix of the above mentioned string.
Comments bubble
parseInt(string, radix);
The radix is an integer between 2 and 36.
Doc URL
https://developer.mozilla.org/it/docs/Web/JavaScript/Reference/Global_Objects/parseInt
Doc URL
https://developer.mozilla.org/it/docs/Web/JavaScript/Reference/Global_Objects/parseInt
Origin
https://www.w3schools.com/jsref/jsref_parseint.asp
Origin
https://www.w3schools.com/jsref/jsref_parseint.asp