复杂对象内的导航(js)

时间:2017-01-27 00:50:10

标签: javascript php arrays object

我有一个结构非常复杂的对象:) 像那样:

{
    "0":[ {} ],
    "1" : [],
    "2" : [],
    "3" :
        [
            [
                {"row" : 0, "name" : "Test","price" : 15,"count" : 10},
                {"row" : 1, "name" : "Test","price" : 15,"count" : 10},
                {"row" : 2, "name" : "Test","price" : 15,"count" : 10},
                {"row" : 3, "name" : "Test","price" : 15,"count" : 10},
                {"row" : 4, "name" : "Test","price" : 15,"count" : 10},
                {"row" : 5, "name" : "Test","price" : 15,"count" : 10},
                {"row" : 6, "name" : "Test","price" : 15,"count" : 10}
            ],
            [
                {"row" : 0, "name" : "Test","price" : 15,"count" : 10},
                {"row" : 1, "name" : "Test","price" : 15,"count" : 10},
                {"row" : 2, "name" : "Test","price" : 15,"count" : 10}, //here new count let be 20.
                {"row" : 3, "name" : "Test","price" : 15,"count" : 10},
                {"row" : 4, "name" : "Test","price" : 15,"count" : 10},
                {"row" : 5, "name" : "Test","price" : 15,"count" : 10},
                {"row" : 6, "name" : "Test","price" : 15,"count" : 10}
            ],
            [],
            [],
            ...,
            []    
        ],
    "4":[ { } ],
    "5":[]
}

我需要替换他的一些价值观。我如何在指定地点设置新计数?

0 个答案:

没有答案