I know this questions exists like 100 times, but I just can't transfer the solutions to my code, so I hope you can help me. This should be pretty easy but I just don't get it working.
This is just my code with other variable because of reasons:
My Code:
for (var key in array) {
}
The JSON I want:
[{
    key: "One",
    y: 5
}, {
    key: "Two",
    y: 2
},];
Pseudo JSON:
[{
    key: key,
    y: array[key].data
},{
    key: key,
    y: array[key].data;
},];
 
     
     
     
     
     
     
    