Сообщение от emptinessandform
|
вызов namedOne.fullName() должен быть без скобок
|
Вариант "без скобок"...
var namedOne = new NamedOne("Ваня", "Иванов");
namedOne.setName("Петя","Петров");
alert(namedOne.fullName);
function NamedOne(first, last) {
this.setName=function (first, last){
this.firstName = first;
this.lastName = last;
this.fullName = this.firstName + ' ' + this.lastName;
};
this.setName(first, last);
};