Functions may take an arbitary number of arguments: function User() { this.name = User.arguments[0]; this.group = User.arguments[1]; this.email = new Array(); n = User.arguments.length; for (var i = 2; i < n; i++) this.email[i-2]=User.arguments[i]; } |
Note: the arguments[] array is built in |