Add a property to an object returned by a function?
<p>I would like to know if there is a way to get all properties of 'myFields' assigned in a single statement ?</p>

<p>This works:</p>

<pre><code>function fieldMap(namesString) {
    var result = {};
    var names = namesString.split(' ');
    for (index in names) {
        var name = names[index];
        result[name] = name + '/text()';
    }
    return result;
}
var myFields = fieldMap('title rating author url');
myFields['cover']="@cover";
</code></pre>

<p>This doesn't work:</p>

<pre><code>var myFields = fieldMap('title rating author url')['cover']='@cover';
</code></pre>
