JavaScript (JQuery) change name of parameter
<p>Is it possible to change the name of a parameter in a JavaScript object?</p>

<p>My question arises from that the JQuery AutoComplete is very fussy about parameter names and requires a parameter name either label or value.</p>

<p>My data object.</p>

<pre><code>data....
data.receivers[].id
data.receivers[].name
data....
</code></pre>

<p>What I would like to do is make an alias/reference or similar conceptual like this.</p>

<pre><code>data.receivers[].label = data.receivers[].name
</code></pre>

<p>So I would like to change a parameter from name to label. I have done it this way but I don't like to duplicate the data which I believe .map does.</p>

<pre><code>var callBack = function(data) {
    var autoCompleteData = jQuery.map(data.receivers, function(receiver, i){
          return {label: receiver.name, id: receiver.id };
    });

    $("input#reciever").autocomplete({
        source: autoCompleteData,
        focus: function(event, receiver) {
            $("input#reciever").val(receiver.item.label);
            return false;
        },
        select: function(event, receiver) {
            $("input#reciever").val(receiver.item.label); 
            $("input#recieverId").val(receiver.item.id);
            return false;
        }

    });
}
</code></pre>

<p>Ps. I could change the JSON return data from my server but I want to keep the names logical and intuitive and not be forced to model by data object according to JQuery's constraints.</p>
