I have an object:
var o = { dates: { dateFrom: "01DEC2012", dateTo: "02DEC2012" }, selection: "A" };
and a function:
var getSelection = function () {
return { selection: "A,B" };
};
calling:
o.selection = getSelection();
gets me:
{ dates: { dateFrom: "01DEC2012", dateTo: "02DEC2012" }, selection: { selection: "A,B"} };
while I need:
{ dates: { dateFrom: "01DEC2012", dateTo: "02DEC2012" }, selection: "A,B" };
I know that I can fetch getSelection() result into a variable and then update o manually, but my object is a whole lot more complex, I need to to set the whole thing in one go. How do I do that?