original data
var array = [
{
id:1,
name:""
},
{
id:2,
name:""
}
];
data I want to change:
var array = [
{
value:1,
label:""
},
{
value:2,
label:""
}
];
The corresponding value of remains the same, but the name of key is changed. How to implement it with js?