Updating a part of the object works but it updates even before I update it
<p>Im updating a part of an object and the update works fine.Its when I did a console.log on the object before the I called the update functio,n the object was already updated.I was expecting to see the old copy of the object,i know Im doing something really silly.I just want to understand why this is happening.Here is my code</p>

<pre><code>function updateObject(o){
            o.a='oneHundred';
            o.b='twoHundred'
        }

        var obj={
            a : 'one',
            b : 'two',
            c : {
                    a : '',
                    b : ''
                }
        }

        console.log(obj);//outputs the updated object before I call updateObject()

        var upObject = obj.c ;

        updateObject(upObject);

        console.log(obj);
</code></pre>
