js object deletion according to a data id


title: js delete a target data according to the above mentioned id
DATE: 2020-03-18 11:52:38
Tags: JS


function deleteRow (id) {
    for(let i in obj) {
        if(obj[i].id == id) {
            obj.splice(i,1)
        }
    }
}

Guess you like

Origin www.cnblogs.com/serahuli/p/12516647.html