<SCRIPT type = "text/JavaScript">
VaR arrayone = new array ("one", "two", "three", "four", "five ");
VaR sortedarray = arrayone. Sort (); // sort
VaR reversearray = sortedarray. Reverse (); // Reverse Order
VaR arraytwo = new array ("ABC", "def", "Ghi ");
VaR arraythree = new array ("von", "Ken", "Mo ");
VaR joinedarray = arrayone. Concat (arraytwo, arraythree); // array Link
VaR lineup = arraythree. Join ('#'); // convert an array to a string
Alert (lineup );
VaR members = lineup. Split ('#'); // convert a string to an array
Alert (members. Length );
VaR sliceofarray = arrayone. Slice (); // truncates a string
Document. Write (sliceofarray [0] + "<br> ");
Document. Write (sliceofarray [1] + "<br> ");
Document. Write (sliceofarray [2] + "<br> ");
Document. Write ("joinedarray has" + joinedarray. Length + "elements <br> ");
Document. Write (joinedarray [0] + "<br> ");
Document. Write (joinedarray [10] + "<br> ");
Document. Write ("----------------------- <br> ");
Document. Write (sortedarray [0] + "<br> ");
Document. Write (sortedarray [1] + "<br> ");
Document. Write (sortedarray [2] + "<br> ");
Document. Write (sortedarray [3] + "<br> ");
Document. Write (sortedarray [4] + "<br> ");
Document. Write ("-------- reversed ---------- <br> ");
Document. Write (reversearray [0] + "<br> ");
Document. Write (reversearray [1] + "<br> ");
Document. Write (reversearray [2] + "<br> ");
Document. Write (reversearray [3] + "<br> ");
Document. Write (reversearray [4] + "<br> ");
</SCRIPT>
Common Array Operations