Array.sort is case sensitive : Sort : Array JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Array » Sort »

 

Array.sort is case sensitive

















<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()">

</body>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Array
» Sort