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

-1不是倒数第一个吗,为什么输出的结尾位置是倒数第二个

 var myarr1= ["我","爱","你","aa","r2sd","sg"];   document.write(myarr1.slice(2,-1));   //你,aa,r2sd

提问者:慕的地7112823 2024-06-26 10:44

个回答

  • 阳火锅
    2024-06-26 14:17:04

    同学请看https://img1.sycdn.imooc.com/667bb25f000153a708450526.jpg