Copying properties from one object to another with a condition
<p>Lazy-me is wondering if there a better way to copy the properties in one object (source) over to another object (destination) only if the properties exist in the latter? It does not necessarily have to be using Underscore.</p>

<p>For example,</p>

<pre><code>_.mixin({
    assign: function (o, destination, source) {
        for (var property in source) {
            if (destination.hasOwnProperty(property)) {
                destination[property] = source[property];
            }
        }
        return destination;
    }
});

console.log( _().assign({ a: 1, b: 2, d: 3 }, { a: 4, c: 5 }) ) // a: 4, b: 2, d: 3
</code></pre>