用两个负数怎样输出“爱“,”你”两个字

<!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(-3,-1))

</script>

</head>

<body>

</body>

</html>


慕瓜4047880
浏览 776回答 1
1回答

OneKi

 document.write(myarr1.slice(-3,-1))  改成   document.write(myarr1.slice(1,3))
打开App,查看更多内容
随时随地看视频慕课网APP