Cut the object into several arrays according to the contents of the object

is to traverse the whole object. When args is empty, the following data is automatically saved into an array, which is divided into three arrays. How should I write clipboard.png

?
Sep.17,2021

const result = [];
list.forEach(item => {
    if (!item.args) {
        result.push([]);
    }
    result[result.length - 1].push(item);
})

here is an idea:

you can get the args empty group index

first.
const idxArr = list.findIndex((item) => {
  return !item.args
})

then in the loop of the array idxArr , each array

is fetched using the slice () method of the js array. In

lodash, there is a chunk that is simply cut into a two-dimensional array, so you can just manipulate it

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1beea8c-31c0d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1beea8c-31c0d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?