How to judge the following table by the attribute values of an array object and split it into two arrays

as shown in the figure, determine the subscript of the object name in the array and split the array into two arrays from the following table. Thank you

Mar.16,2021

let arr = [{
    fieldName: 'hello',
    valueVOs: []
}, {
    fieldName: 'hello',
    valueVOs: []
}, {
    fieldName: '',
    valueVOs: []
}, {
    fieldName: 'hello',
    valueVOs: []
}, {
    fieldName: 'hello',
    valueVOs: []
}]
function trans (arr) {
    let index = arr.findIndex(a => a.fieldName === '') // 
    if (index !== -1) {
        return [arr.slice(0, index), arr.slice(index)]
    }
    return [arr.slice()]
}
trans(arr)



const getNewArray = (data) => {
    let newArray = [[],[]];
    data.forEach((val) => {
        if (val.fieldName === "") {
            newArray[1].push(val)
        } else {
            newArray[0].push(val)
        }
    })

    return newArray
}
getNewArray(data)
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-1b35929-2b30a.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-1b35929-2b30a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?