Question: I tried to use the following code to add a `start` method to an object:

```
var Bounce = Bounce || {
    Info : {},
    Game : {}
};

Bounce.Game.prototype.start = function() {
    Bounce.log("Starting " + new Bounce.Info());
}

```

But this results in the following error (on the `Bounce.Game.prototype.start` line):

> 
> Uncaught TypeError: Cannot set property 'start' of undefined
> 
> 
> 

Looking at the object in Chrome's console, I can see that it doesn't contain the `prototype` object (but has `toString`, `valueOf` and `constructor` etc.).

This is easily fixed by adding the following line before the prototype access:

```
Bounce.Game = function() {};

```

I don't know why this is necessary when the object has already been initialized? 

[W3Schools](http://www.w3schools.com/js/js_object_prototypes.asp) tells me "Every JavaScript object has a prototype", but that doesn't appear to be the case.

Answer: 
Conceptually, all objects do have a prototype, but only function objects (including constructors like `Object`, `Array`, although they don't produce functions) have a **property** named `prototype`. They are not the same.

If you read the ECMAScript spec, prototype is usually represented like **[[Prototype]]**, which is an implementation detail lies in the JS engine, rather than a language feature. However, in some engines **[[Prototype]]** is exposed and can be accessed with `__proto__` property (non-standard).

---

By the way:

1. If you want to access **[[Prototype]]**, `Object.getPrototypeOf()` is your friend.
2. When using `a instanceof b`, it's actually comparing `a`'s **[[Prototype]]** chain with `b`'s `prototype` **property**.
3. And why we say `null` is the prototype of all? It's also not referring to `prototype` but **[[Prototype]]**:

```
Object.getPrototypeOf(Object.getPrototypeOf({})) // null
Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf([]))) // null
Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(new String("")))) // null

// or shorter like this
({}).__proto__.__proto__ // null
([]).__proto__.__proto__.__proto__ // null
("").__proto__.__proto__.__proto__ // null

```
So, inspired by [@Leo](https://stackoverflow.com/users/1032492/leo) comments, I think about this solution to use a plain `{}` object with its prototype.

We have this object:

```
var Bounce = Bounce || {
    Info : {},
    Game : {}
};

```

We define the `prototype` property for the given object

```
Object.defineProperty(Bounce.Game, 'prototype', {
    get: function() {
      return Object.getPrototypeOf(Bounce.Game); 
    }
});

```

Now, we can use prototype as usual:

```
Bounce.Game.prototype.start = function(){
  console.log('start');
};

Bounce.Game.start();

```

Check this out: [http://jsbin.com/bapuvo/3/edit](http://jsbin.com/bapuvo/3/edit?js,console)