Code in this page
var test = function(name)
{
this.name = name;
}
test.prototype= {
setInitial: function( b )
{
name=this.name;
if (b)
{
this.callback = {
//***************************************
initial: function(){return this.arg[0];},
//***************************************
arg: name
}
}
else
{
this.initial=name[0];
}
},
getInitial: function()
{
if (this.callback)
return this.callback.initial();
else
return this.initial;
}
}
r= new test('raphael');
c= new test('cathy');
r.setInitial(true);
c.setInitial();
Test it
=