```
var o = Object.create({inherited: 1}, {
foo: {
  get: (function () { // a closure
      var closured = 'foo';
      return function () {
        return closured+'bar';
      };
    })()
  }
});

o.foo; // "foobar"

```

I'm having some issues with this. I don't really understand how we're getting the string `"foobar"` as a result. I'll write my current erroneous understanding of this code, and hopefully someone can explain where I'm mistaken.

1. `o` is an object with the property `foo`.
2. `foo` corresponds to an object with one property, `get`. (This seems to be mistaken but I can't see how.)
3. `get` corresponds to self-invoking anonymous function that returns a function consisting of the one line `return closured+'bar';`

That being said, I would expect `o.foo` to return an object, and `o.foo.get` to return a function, and `o.foo.get()` to return `"foobar"`.

But that's not what's happening, and I don't know why.

Also, separately, why would you ever write something this way? Why write:

```
get: (function () { // a closure
      var closured = 'foo';
      return function () {
        return closured+'bar';
      };
    })()

```

Instead of simply:

```
get: (function () { // a closure
      var closured = 'foo';
        return closured+'bar';
    })()

```

What good is done by the extra function layer?