Does jQuery Extend Create an Emtpy Object When Target is Undefined
<p>Working with the jQuery extend functionality and have run into a case where I am trying to extend a target object that is undefined. I don't get any errors but the source object is not extended as expected. I had assumed that jQuery would create a blank object and extend to that but this does not seem to be the case. I can work around this by creating the empty object my self but I am looking for some confirmation that this is the case with jQuery's extend. I could not find anything in the jQuery Api about the target object being undefined.</p>

<p>EDIT: Sorry I should have included a JSFiddle - <a href="http://jsfiddle.net/RgpDb/" rel="nofollow">Here</a> or see the example below. And in doing so need to modify my question. If you look in the fiddle the options object exists, but the property I'm trying to extend to does not exist. This is where my problem is lying. I am guessing jQuery won't create the empty property this way. And I would need to add the property to the object manually?</p>

<pre><code>options = {newdata:true};

$("#click").click(function(){
  console.log(options);
  someFunc(options);
});

function someFunc(options) {
  $.extend(options.data, {
    someNewData: true
  });
  console.log(options);
}
</code></pre>
