I understand that in Javascript, variables are always assigned by reference which means that if I write :

```
var a = {};
var b = a;
b.foo = 'string';
console.log(a.foo); // prints 'string'

```

Right, so writing the following code returns an error:

```
var a = function(){};
var b = function(){};

b.foo=a;
a.bar = b;

console.log(a); // prints { [Function] bar: { [Function] foo: [Circular] } }

```

This is ok, for a.bar points to b and b.foo points to a, whose .bar parameter points again to b and so on. This is a circular reference.

Now, I noticed the following thing :

```
var a = function(){};
var b = function(){};

b.foo=a;
a.prototype = b;

console.log(a); // prints [Function]

```

I just replaced a.bar with a.prototype and now, I've got no circular reference error. 

I presume this means that Object.prototype cannot be assigned a value by reference. Can anyone confirm? Is this an exception to the rule (at least if it is true there is one)? 

Thank you !