K
K
Kusmich2015-10-29 23:27:17
JavaScript
Kusmich, 2015-10-29 23:27:17

How to access object property chain?

There is an object whose properties need to be accessed. And I wanted to know how to do it right.
I need to get the url that are responsible for the pictures of the participants. But since initially these urls are broken into 3 different objects. Then you need to get 3 arrays that will contain these urls. The entry should be of the form

.


How I try to access them: This is how I get to the members. And what to do next? After all, listing each participant in order to take property from him is stupid, how to solve this problem? Here is the object itself:json_date[0].dills[1].Participants


var json_date = [{
    "dills": {
        "1": {
            "Participants": {
                "1": {
                    "denis": {
                        "url": "img/humen.png"
                    }
                },
                "2": {
                    "nikolya": {
                        "url": "img/humen.png"
                    }
                },
                "3": {
                    "anton ": {
                        "url": "img/humen.png"
                    }
                }
            }
        },
        "2": {
            "Participants": {
                "1": {
                    "Vladeslav": {
                        "url": "img/humen.png"
                    }
                },
                "2": {
                    "Nikita": {
                        "url": "img/humen.png"
                    }
                },
                "3": {
                    "Andrey": {
                        "url": "img/humen.png"
                    }
                }

            }
        },
        "3": {
            "Participants": {
                "1": {
                    "Olga": {
                        "url": "img/humen.png"
                    }
                },
                "2": {
                    "Lina": {
                        "url": "img/humen.png"
                    }
                }
            }
        }
    }
}]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
inDeepCode, 2015-10-29
@inDeepCode

nested loops.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question