<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Array对象 </title>
<script type="text/javascript">
var myarr1= ["我","爱","你"];
var myarr2=myarr1.slice("0,1");
document.write(myarr2+"<br>");
document.write(myarr1.slice(0,1)+"<br>");
document.write(myarr1.slice(1));
</script>
</head>
<body>
</body>
</html>
选定元素不应该用”“
选定元素不用“” 应该是var myarr2=myarr1.slice(0,1);
为什么运行结果是这个
我,爱,你
我
爱,你
而不是
我
我
爱你