javascript:object
<p>At last there i see a smell of closure in the following code.  </p>

<pre><code>function create(parent) {
var F = function() {};
 F.prototype = parent;
return new F();
}

var masterObject = {a: "masterObject value"}
var object1 = create(masterObject);
var object2 = create(masterObject);
var object3 = create(masterObject);
var object3.a = "overridden value";

object1.a; // "masterObject value"
object2.a; // "masterObject value"
object3.a; // "overridden value"

masterObject.a = "new masterObject value"//value is changed now

object1.a; // "new masterObject value"
object2.a; // "new masterObject value"
object3.a; // "overridden value"
</code></pre>

<p>the value of object1.a ,abject2.a is changed permamently .Is this because i made a change in global variable or that is the affect of closure?since i have not invoked the Create() function again why is the value changed automatically?
last question "when i made a change in global variable does that automatically affect all the object using tht variable?"in my view to make an effect of that variable i should call the Create() function again isn't it?</p>
