问答详情
源自:7-21 选定元素slice()

求大佬看看

<!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>



提问者:weixin_慕圣4239398 2020-07-25 21:42

个回答

  • 慕无忌4360779
    2021-04-08 21:45:09

    选定元素不应该用”“

  • 入门到入坟
    2020-08-21 18:05:03

    选定元素不用“”   应该是var myarr2=myarr1.slice(0,1); 

  • weixin_慕圣4239398
    2020-07-25 21:43:48

    为什么运行结果是这个

    我,爱,你

    爱,你

    而不是

    爱你