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