About the problem of array traversal, I would like to ask you js.

let data = [{"":"a1","":"0026"},{"":"a2","":"0026"},{"":"a3","":"0026"},{"":"a4","":"0026"},{"":"a5","":"0026"},{"":"a6","":"0026"},{"":"a7","":"0026"},{"":"a8","":"0026"},{"":"a9","":"0026"}];



//,
let result = [[{"":"a1","":"0026"},{"":"a2","":"0026"},{"":"a3","":"0026"},{"":"a4","":"0026"}],[{"":"a5","":"0026"},{"":"a6","":"0026"},{"":"a7","":"0026"},{"":"a8","":"0026"}],[{"":"a9","":"0026"}]]
Mar.07,2021

divided into groups of four?

var result = [];
for (var i = 0, len = data.length; i < len; i += 4) {
  result.push(data.slice(i, i + 4));
}

let newArr = [];
for(let i = 0; i < data.length/4; iPP){
    newArr.push(data.slice(i, i+4))
}

same as above.


[ [ { '': 'a1', '': '0026' },
    { '': 'a2', '': '0026' },
    { '': 'a3', '': '0026' },
    { '': 'a4', '': '0026' } ],
  [ { '': 'a5', '': '0026' },
    { '': 'a6', '': '0026' },
    { '': 'a7', '': '0026' },
    { '': 'a8', '': '0026' } ],
  [ { '': 'a9', '': '0026' } ] ]
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-1b3c007-4131d.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-1b3c007-4131d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?