G
G
grisha2282020-05-06 16:27:34
JavaScript
grisha228, 2020-05-06 16:27:34

How to remove from an array?

There is an array like

[{id: "1", name: "Имя", price: "Цена"}, {id: "2", name: "Имя", price: "Цена"}]

How do I remove the entire value while leaving it in an array
{id: "1", name: "Имя", price: "Цена"}
{id: "2", name: "Имя", price: "Цена"}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2020-05-06
@grisha228

array.filter(entry => (
  entry.name !== 'Имя' &&
  entry.price !== 'Цена'
));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question