Javascript examples for Array:Quiz
Use the sort() method to sort the array alphabetically.
<!DOCTYPE html> <html> <body> <p id="demo"></p> <script> var myArray = ["Javascript", "HTML", "CSS", "SVG"]; myArray.sort();/*from w ww . java 2s . com*/ document.getElementById("demo").innerHTML = myArray; </script> </body> </html>