Though an old question, but maybe this can be helpful to someone.
I use this way of converting string to int number:
var str = "25"; // stringString var number = str*1; // numberNumber So, when multiplying by 1, the value does not change, but jsJavaScript automatically returns a number.
But as it is shown below, this should be used if you are sure that the str is a number (or can be represented as a number), otherwise it will return NaN NaN - not a number.
youYou can create simple function to use, e.g.,
function toNumber(str) { return str*1; } 
