Prompt as it is possible to translate a string to number so that only any variant except for the integer produced an error.
func('17') = 17;
func('17.25') = NaN
func(' 17') = NaN
func('17test') = NaN
func('') = NaN
func('1e2') = NaN
func('0x12') = NaN
ParseInt does not work, because it does not work correctly.
ParseInt('17') = 17;
ParseInt('17.25') = 17 // incorrect
ParseInt(' 17') = NaN
ParseInt('17test') = 17 // incorrect
ParseInt('') = NaN
ParseInt('1e2') = 1 // incorrect
And most importantly: for the function to work in IE, Chrome and other browsers!!!