How does js modify the key value of an object?

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?

Mar.31,2021

var arr = [
                {
        id:1,
        name:""
    },
    {
        id:2,
        name:""
    }
            ];
            var newArr = arr.map(function(item) {
                return {
                    value: item['id'],
                    lable: item['name']
                }
            })
            console.log(newArr) 
Menu