0

I want to delete a particular object from an object array. the array as follow

    data_list = [
        {
            {
                name: "george",
                age : 20,
                address: "new york"
            },
            {
                name: "mavan",
                age : 23,
                address: "new york"
            },
            {
                name: "chris",
                age : 25,
                address: "melborn"
            },
            {
                name: "jerry",
                age : 26,
                address: "dubai"
            }
        }
    ]

I want to delete follow object by consider the name attribute. that is chirs

{
    name: "chris",
    age : 25,
    address: "melborn"
},

what should I do for this.

1 Answer 1

1
data_list = data_list.filter(obj => obj.name !== 'chris')
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.