<!DOCTYPE html>
<html>
<head>
<title>js6.html</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
</head>
<body>
<!-- 数组的使用方法 -->
<script type = "text/javascript">
var fruit = ["苹果","香蕉","橘子"];
with(document){
write("<ul>");
write("<li>" + fruit.join() + "</li>");
write("<li>" + fruit.join(":") + "</li>");
write("<li>" + fruit.toString() + "</li>");
write("<li>" + fruit.reverse().join() + "</li>");
write("<li>" + fruit.valueOf() + "</li>");
write("</ul>");
}
</script>
</body>
</html>
说明:valueOf是把一个对象转换成它的初始值。 reverse 是把数组反向。 join是连接。