Using the Methods of the Array object
<HTML>
<HEAD>
<TITLE>Using Arrays</TITLE>
<SCRIPT LANGUAGE="JavaScript"><!--
// --></SCRIPT></HEAD>
<BODY>
<H1>Using Arrays</H1>
<SCRIPT LANGUAGE="JavaScript"><!--
myArray = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
document.write("myArray: "+myArray+"<P>")
document.write("myArray.toString(): "+myArray.toString()+"<P>")
document.write("myArray.join(':'): "+myArray.join(':')+"<P>")
document.write("myArray.reverse(): "+myArray.reverse()+"<P>")
document.write("myArray.sort: "+myArray.sort())
// --></SCRIPT>
</BODY>
</HTML>
Related examples in the same category