JavaScript converts a string to an integer

  • 2020-05-27 04:25:28
  • OfStack

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.


Related articles: