function Person(first, last) {
return {
first: first,
last: last,
fullName: function() {
return this.first + ' ' + this.last;
},
fullNameReversed: function() {
return this.last + ', ' + this.first;
}
};
}
p = Person("James", "Bond");
var fullName = p.fullName;
fullName();
I was expecting Output = 'James Bond' but get 'undefined undefined'