Set range element index on one property that shares a name with another in another nest

58 Views Asked by At

I have JSON object that looks like this:

{
    "menu": {
        "id": "file", // need to set range element index only on property id inside menu 
        "value": "File",
        "popup": {
            "menuitem": [
                {
                    "value": "New", // not inside menuitem
                    "onclick": "CreateDoc()"
                },
                {
                    "value": "Open",
                    "onclick": "OpenDoc()"
                },
                {
                    "value": "Save",
                    "onclick": "SaveDoc()"
                }
            ]
        }
    }
}

Is it possible in any way to set index only on the id property inside the menu/id nest not inside menu/menuItem/id?

1

There are 1 best solutions below

0
On