jquery javascript remove object data from JSON object

前端 未结 3 2024
迷失自我
迷失自我 2021-01-03 14:01

I have JSON Object that looks something like the below object, this object can go on for days. So I am wondering is there anyway I can delete full set a set being the equiva

3条回答
  •  佛祖请我去吃肉
    2021-01-03 14:30

    It worker for me.

      arrList = $.grep(arrList, function (e) { 
    
            if(e.add_task == addTask && e.worker_id == worker_id) {
                return false;
            } else {
                return true;
            }
        });
    

    It returns an array without that object.

    Hope it helps.

提交回复
热议问题