how can i fix it, Simple JavaScript Inheritance problem
see this first plz:
http://ejohn.org/blog/simple-javascript-inheritance/
I am studying the "Simple JavaScript Inheritance" :
look this sample below:
var Person = Class.extend({
name:['a','b','c']
});
var Ninja = Person.extend({
dance: function(){
return this.name;
}
});
var c = new Ninja();
var d = new Ninja();
d.name[0]="z";
//result
document.write(c.dance());// z,b,c
document.write(d.dance());// z,b,c
//what i want
document.write(c.dance());// a,b,c
document.write(d.dance());// z,b,c
how can i fix it
sb help me