0
 function splitTheBill(x) {

 var obj1 = Object.assign({}, x);
 Object.assign(obj1, {A: 5, B: 0, C: -5})

 var obj2 = Object.assign({}, obj1);
 delete obj2["C"]
 Object.assign(obj2, {A: 15, B: 0, X: -15})

 return (obj1);

In this project I am trying to return obj1 and obj2 after I have modified the key properties using the Object.assign function, and also deleting one of the keys for the 2nd object, I clone the x object which is the function parameter. My challenge is that the return function in Javascript wont accept two objects as parameters to return, one the first one is met it terminates the function and displaying the second object contents does not happen. Can anyone please help me resolve this? Thanks in advance for your help (I was thinking to either combine the two objects in to one, or parse to an array and call the array elements off, but I am a newbie so need a little help:0) Kind regards, Jon

0 Answers0