You are here: irt.org | FAQ | JavaScript | Number | Q269 [ previous next ]
<script language="JavaScript"><!-- var myinteger = 123; var mystring = myinterger + ''; //--></script>
To do the reverse, simply subtract zero from the string:
<script language="JavaScript"><!-- var mystring = '123'; var myinteger = mystring - 0; //--></script>