xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

array auto slice

array auto slice

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice


    let selectedIndex = 0;
    for (let i = 0; i < dateList.length; i++) {
      if (dateList[i].ticketGroupId === selectedId) {
        log(`selectedId index`, i)
        selectedIndex = i;
        break;
      }
    }
    const tempArr = dateList;
    const list = this.listShaper(tempArr.slice(selectedIndex, selectedIndex + 4));


posted @ 2020-04-13 18:10  xgqfrms  阅读(121)  评论(0编辑  收藏  举报