building an object in javascript using properties from another object
<p>What I am trying to do is create an object which has x number of properties in it along with y number of properties from another object I retrieve from calling another method.  Is this possible to do?</p>

<p>ie Here is my pseudo code.  Basically I want mydata to include all the properties from the object I get back from getMoreData()
Maybe this is not possible but I have no idea how to do it if it is :(</p>

<pre><code>var mydata = 
{
    name: "Joe Soap",
    dob: "01-01-2001",
    otherData: {
        hasCat: true,
        hasDog : false
    }

    var otherData = getMoreData();
    for(var prop in otherData)
    {
        create additional property in mydata for prop;
    }
}

function getMoreData()
{
    var moreData = 
    {
        middleName: "tom",
        location: "uk"
    }
    return otherData;
}
</code></pre>
