W3School TIY
(请在下面的文本框中编辑您的代码,然后单击此按钮测试结果。)
编辑您的代码:
<html> <body> <script type="text/javascript"> var arr = new Array(6) arr[0] = "George" arr[1] = "John" arr[2] = "Thomas" arr[3] = "James" arr[4] = "Adrew" arr[5] = "Martin" document.write(arr + "<br />") document.write(arr.sort()) </script> </body> </html>
查看结果: