function Parent(username)
{
this.username = username;
this.sayHello = function()
{
alert(username );
}
}
function Child(username,pwd)
{
this.method = Parent;
this.method (username);
delete this.method;
this.pwd = pwd;
this.sayWorld = function()
{
alert(pwd);
}
}
var p = new Parent("zhangsan");
var c = new Child("zhangsan","123456");
p.sayHello();
c.sayHello();
c.sayWorld();