Setting objB = objA only creates a copy of objA. It does not create a new instance of the object.
What you need to do is to create a new object from objA then they become separate entities.
var objB = new objA
objB then inherits all the properties and values from objA, but only at the time of instantiation, so subsequent changes to the objA will not affect objB.
So. Welcome to the wonderful world of Object Oriented Programming and Inheritance then 
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
|