When converting Javascript values and strings, you can operate on different bases. Conversion example is as follows: Copy code The code is as follows: < html> Within Convert between numerical values and strings <br>//Numbers Conversion to string: toString(), can be converted into different bases <br>function test1(){ <br>var f = [1,2,3,4,5,6,7,8]; <br> alert(f.reverse().join("")); //Reverse function of array, connection function test<br>var b = parseInt(f.reverse().join("")).toString(2 ); <br>alert(b); <br>} <br><br>//Character to numerical conversion: parseInt(), which can convert data in different bases <br>function test2(){ <br> var s = '10101010'; <br>var b = parseInt(s,2); <br>alert(b); <br>} <br><br>test2(); <br>