Lachee1
1
i would like to now if there is a way to convert string (like 132) into a number USING javascript.
Eric5h5
2
Use the .net feature Parse:
var s = "1234";
var i = int.Parse(s);
`parseInt` does the same thing:
var s = "1234";
var i = parseInt(s);
If there's any chance the string contains non-numeric characters, use TryParse:
var s = "1234";
var i : int;
if (int.TryParse(s, i)) print ("Succeeded, and the result is " + i);