慕婉清0208
2018-03-13 20:30
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Array对象 </title>
<script type="text/javascript">
var myarr1= ["我","爱","你"];
document.write(myarr1.slice(1)+"<br>");
document.write(myarr1.reverse()+"<br>");
document.write(myarr1.slice(-1)+"<br>");
</script>
</head>
<body>
</body>
</html>
myarr1.reverse()已经将数组顺序调换了,这个时候你的myarr1=["你","爱","我"]
JavaScript进阶篇
468060 学习 · 21891 问题
相似问题