0

this is the data ,

var dataList = {
    "Air": {
        "Rules Configuration": {
            "Rules Configuration": "sample data1"
        }
    },
    "Car": {
        "Car Rules Configuration Setup": {
            "Car Rules Configuration Setup": "sample data2"
        },
        "Commissions": {
            "Commission Setup": "sample data3"
        },
        "Reports": {
            "Car Commission Report": "sample data4",
            "Car Rental Profit Markup Report": "sample data5"
        }
    }
};

How is the loop this json with java script, for get level 1 data level 2 data and level 3 data?

gimhanas
  • 69
  • 5
  • 1
    That's a JavaScript object, not a JSON string. Use typical object access e.g. `dataList.Air.xyz`. You can also [iterate over the properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in). – jarmod Feb 15 '23 at 13:07

0 Answers0