Type Method
Format Object array . Sort (compare function)
Commentary
Sort the elements of an array . Compare function is optional. Specifies a function that defines the sort order. If omitted, the array is sorted lexicographically (in dictionary order) according to the string conversion of each element.
Sample code - QC 2 JavaScript
myAry1 = new Array (5,7,2,8,1);
n = myAry1.sort ();
outputs [0] = n.toString ();
Sample code - QC 3 JavaScript
var myArrayB = new Array(5,7,2,8,1);
var outputArray = new Array();
var n = myArrayB.sort();
function (__string outputArray) main ()
{
var result = new Object();
result.outputArray = n.toString();
return result;
}