I have trouble to understand this, even fumble around on internet. Here is my snippet in javscript:
TEST=function(){};
TEST.prototype={
b:{
b1:"",
b2:{}
}
};
//Instance 1
var first=new TEST();
first.b.b1="TEXT";
//Instance 2
var second=new TEST();
console.log("Result",second.b.b1);
Console log will output "TEXT", and I want "". So I am wondering why I get this result, and why do it change the "TEST" prototype (that's my main issue), when creating a new instance and then set values?
I got help from Bergi and Mykola (Thanks) and a duplicate. But I still think I lost a resource by this behavior, and wondering why it is build this way? It is not necessary to update prototype when working on a instance.