JSON convert with Javascript : <p>I have a json file like as below</p>

<pre>
[{
    "id": 2,
    "name": "Ali",
    "records":[{
        "type": "L",
        "total": 123
    }, {
        "type": "P",
        "total": 102
    }]
},{
    "id": 3,
    "name": "Mete",
    "records":[{
        "type": "O",
        "total": 100
    }, {
        "type": "T",
        "total": 88
    }]
}]
</pre>

<p>I want to convert to like this</p>

<pre>
[{
    "id": 2,
    "name": "Ali",
    record: {
        "type": "L",
        "total": 123
    }
},{
    "id": 2,
    "name": "Ali",
    record: {
        "type": "P",
        "total": 102
    }
},{
    "id": 3,
    "name": "Mete",
    record: {
        "type": "O",
        "total": 100
    }
},{
    "id": 3,
    "name": "Mete",
    record: {
        "type": "T",
        "total": 88
    }
}]
</pre>

<p>how can i do it using javascript?</p>
