Infinite nested elements in a json file - How to get specific element?
<p>this is my json file:</p>

<pre><code>{
  "categories": {

    "category": [
      {
        "id": "1",
        "title": "Android",
    "subcategory": [

        {
            "id": "1",
            "title": "JavaScript",
            "question": [
</code></pre>

<p>My question is: if subcategory element can appear infinite number of times 
as nested in itself how can I get all the elements of every subcategory in my json file to be displayed with the help of javascript?, how can i get dipper in the nesting?
if i'm writing my code:</p>

<pre><code>data.categories.category[i].subcategory[0].subcategory[0].subcategory[0].title          
</code></pre>

<p>that means that I need to add <code>subcategory[0]</code> infinite number of times to get to each
title attribute - creating a lot of different functions to handle every different situation - and this is my problem.</p>
