<title>String Type localeCompare() Example</title>
<script type="text/javascript">
var stringValue = "yellow";
alert(stringValue.localeCompare("brick"));
alert(stringValue.localeCompare("yellow"));
alert(stringValue.localeCompare("zoo"));
function determineOrder(value) {
var result = stringValue.localeCompare(value);
alert("The string 'yellow' comes before the string '" + value + "'.");
alert("The string 'yellow' comes after the string '" + value + "'.");
alert("The string 'yellow' is equal to the string '" + value + "'.");
determineOrder("yellow");