Add element into array decremented every 2thh times : Hi I'm stuck with some math problem.
If i have simple array:

    var x = [
        {
            'index':0,
            "place": 1,
        },
        {
            'index':1,
            "place": 4,
        },
        {
            'index':0,
            "place": 9,
        },
        {
            'index':1,
            "place": 9,
        },
        {
            'index':0,
            "place": 9,
        },
    ];

How can i loop at this array and add some element ('row in this case') to match this ?

    var x = [
        {
            'index':0,
            "place": 1,
            "row":"0",
        },
        {
            'index':1,
            "place": 4,
            "row":"0",
        },
        {
            'index':0,
            "place": 9,
            "row":"1",
        },
        {
            'index':1,
            "place": 9,
            "row":"1",
        },
        {
            'index':0,
            "place": 9,
            "row":"2",
        },
        {
            'index':0,
            "place": 9,
            "row":"2",
        },
    ];

Thanks for any advices. I need this to create dynamic Gridlayout in nativescript.