Reversing, Sorting, and Concatenating an Array : Array : Language Basics JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Language Basics » Array »

 

Reversing, Sorting, and Concatenating an Array



<HTML>
<HEAD>
<TITLE> 
Array methods 
</TITLE>
<HEAD>
<BODY>
<H1>
<SCRIPT
    var theArray = new Array("N","M","T","M")
    document.write ("Original array: " + theArray)
    document.write ("<br>")
    theArray.reverse()
    document.write ("Reversed array: " + theArray)
    document.write ("<br>")
    theArray.sort()
    document.write ("Sorted array: " + theArray)
    document.write ("<br>")
    document.write("Concatenated: " + theArray.concat("Cypher""Mouse"))
    </SCRIPT>
</H1>
</BODY>
</HTML>

           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Language Basics
» Array