P
P
picka2020-12-23 23:35:46
JavaScript
picka, 2020-12-23 23:35:46

Search in JSON array?

There is 1 array:

variable:Array[1]
 0:Object
   articulus:"01-02-01"
   id:10
   quantity:99
   unique_id:1


And there is an article that always changes, for example 01-02-01

How to find an object with the same article in this array?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Kornilov, 2020-12-24
@picka

variable.filter(i=>i.articulus === '01-02-01');
Returns an array with objects of the corresponding article.
UPD : Edited according to the comments from the comments.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question