我可以做类似这样的事情吗?
function User(form) {
this._username = form.username.value;
this._password = form.password.value;
this._surname = form.surname.value;
this._lastname = form.lastname.value;
this._birthdate = form.b_day.value+"-"+form.b_month.value+"-"+form.b_year.value;
this._avatar = form.avatar;
this._messages = new Array();
this._messagesCount=0;
}
function User(userName,password,surname,lastName,birthdate) {
this._username = userName;
this._password = password;
this._surname = surname;
this._lastname = lastName;
this._birthdate = birthdate;
this._avatar = form.avatar;
this._messages = new Array();
this._messagesCount=0;
}