This example demonstrates how JavaScript converts a string to an integer. Share with you for your reference. The details are as follows:
var s='1';
var s2='2';
alert(parseInt(s) parseInt(s2));
I hope this article has been helpful to your javascript programming.