Javascript examples for Data Type:Number
Sort number and number with letters in Javascript
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <p>Click the button to sort the array.</p> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> var array = [101,102,103,"101a","101b",104,"103a","102a",'1X','2E']; document.getElementById("demo").innerHTML = array; function myFunction() {//ww w . j a v a 2 s. c o m array.sort(); document.getElementById("demo").innerHTML = array; } </script> </body> </html>