<p>You don't need a "new" operation to create object to use the method.</p>
<pre data-sub="prettyprint:_">
// 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()
);
};
</pre>
<p>Another way to to do is like the following</p>
<pre data-sub="prettyprint:_">
User = {
run:function(){ alert("run"); }
}
User.walk = function(){alert("walk");}
User.run();
User.walk();
</pre>