topical media & game development

talk show tell print

#javascript-code-26-static.js / js



  // A static method attached to the User object
  User.cloneUser = function( user ) {
      // Create, and return, a new user
      return new User(
          // that is a clone of the other user object
          user.getName(),
          user.getAge()
      );
  };
  
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.