0

I have a question about typescript. I want to remove an element by considering the name of the key value as follow. Let's take the array as follow

let myarr =[
    {
        name: "joe",
        age : 22
    },
    {
        name: "nick",
        age : 23
    },
    {
        name: "tom",
        age : 25
    }
]

I want to remove this part from the main array, by considering the name that nick

{
    name: "nick",
    age : 23
}

What I need to do this thing.

2

1 Answer 1

1
ArrayNameHere = ArrayNameHere.filter((person) => person.name !== "nick")
Sign up to request clarification or add additional context in comments.

1 Comment

What is person

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.