<html> <head> <title>Using the sort() method</title> <script type="text/javascript" language="javascript"> <!-- // function SortElements() { var colors = new Array("red","Red","blue","Blue","green","Green"); colors.sort();
var cj = colors.join(", "); alert("The sorted array contains: " + cj); } // --> </script> </head> <body onload="SortElements()">