Examples parseInt()The parseInt() function parses a string argument and returns an integer
|
Examples parseFloat() |
More Examples
encodeURI - The encodeURI() function encodes a Uniform Resource Identifier (URI) by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two "surrogate" characters).
|
var value = parseInt('1234');
alert(value); output: 1234 var value = parseInt('12z34'); alert(value); output: 12 var value = parseInt('z1234'); alert(value); output: NaN var value = parseInt('1234.5'); alert(value); output: 1234 |
|