Swap value of two properties on object(s)
<p>I'm trying to make a simple function that will swap the values of two properties on the same or different global objects. </p>

<pre><code>object1 = {"key 1":"value 1"};
object2 = {"key 2":"value 2"};

swapValuesInObject ("object1['key 1']","object2['key 2']",true)
// should result in:
// object1 === {"key 1":"value 2"};
// object2 === {"key 2":"value 1"};
</code></pre>

<p>Another example:</p>

<pre><code>object1 = {"key 1":"value 1", "key 2":"value 2"};

swapValuesInObject ("object1['key 1']","object1['key 2']",1===1)
// should result in:
// object1 === {"key 1":"value 2", "key 2":"value 1"};
</code></pre>

<p>Here's what I've been able to come up with so far, but it's not much. Getting hung up on how to do the assignment.</p>

<pre><code>function swapValuesInObject(property1, property2, condition) {
    if (condition) {
        // temp assignment
        var Obj1Value = property1;

        // do the switcheroo
        array1 = array2Value;
        array2 = array1Value;
    }
    return true;
};
</code></pre>

<p>What's the proper way to do this?</p>
