I
I
Ivan Damaskin2015-08-11 18:22:07
JavaScript
Ivan Damaskin, 2015-08-11 18:22:07

How to output json data of an object of only a specific id?

Hello.
1. There are links with categories (each category has its own id)
2. There is a json object where the data of all categories is stored.

You need to click on the category, after which we will take from the json object only the data that belongs to this category that we clicked.

Thanks to everyone who will respond.

For example:
(categories)
1. bosses
2. subordinates
3. interns

And in json object we have all bosses and subordinates and interns.
You need to poke on the "chiefs" and, for example, the names of only the chiefs will appear.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stalker_RED, 2015-08-11
@Joannes

filter() will help you
Example: jsfiddle.net/1ao11oav/1

S
Sergey, 2015-08-11
Protko @Fesor

Array.prototype.filter

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question