The following is constructor which prevent not using "new" keyword
function User(first, last){
if ( !(this instanceof arguments.callee) )
return new User(first, last);
this.name = first + " " + last;
}
Being agile is not forcing agile methodology.
The following is constructor which prevent not using "new" keyword
function User(first, last){
if ( !(this instanceof arguments.callee) )
return new User(first, last);
this.name = first + " " + last;
}
No comments:
Post a Comment