jashkenas/underscore — pull request #1193 by aj0strow (2013-07-08 16:44:02+00:00)
Title: Allow lazy Object initialization with _.defaults

I noticed that if you want to include objects in defaults it doesnt work so well:

```javascript
var defaults = {
someObject: new SomeObject()
};

_.defaults(options, defaults);
```

To fix this, defaults should be allowed to have lazy properties:

```javascript
var defaults = {
someObject: function() { return new SomeObject() }
};
```

and then we change `_.defaults` to use `_.result`. Use cases would be quickly initializing nested hierarchies of objects for a client-side app.

```javascript
new Post({ comments: new Comments() })
new Post() // comments defaulted to new Comments
```