this is my json file:
{
  "categories": {
    "category": [
      {
        "id": "1",
        "title": "Android",
    "subcategory": [
        {
            "id": "1",
            "title": "JavaScript",
            "question": [
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:
data.categories.category[i].subcategory[0].subcategory[0].subcategory[0].title          
that means that I need to add subcategory[0] 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.
 
     
     
    