Tell us what’s happening:
Describe your issue in detail here.
Values are showing up as undefined …?
getFullName: undefined
undefined
**Your code so far**
var Person = function(firstAndLast) {
// Only change code below this line
// Complete the method below and implement the others similarly
this.setFullName = function(firstAndLast) {
this.fullName=firstAndLast;
console.log('setFullName:',this.fullName);
};
this.setFirstName = function(first) {
this.firstName=first;
console.log('setFirstName:',this.firstName);
};
this.setLastName = function(last) {
this.lastName=last;
console.log('setLastName:',this.lastName);
};
this.getFullName = function() {
console.log('getFullName:',this.fullName);
return this.fullName;
};
this.getFirstName = function() {
return this.fullName.split(' ')[0];
};
this.getLastName = function() {
return this.fullName.split(' ')[1];
};
return this.fullName;
};
var bob = new Person('Bob Ross');
console.log(bob.getFullName());
var Person = function(firstAndLast) {
// Only change code below this line
// Complete the method below and implement the others similarly
this.setFullName = function(firstAndLast) {
this.fullName=firstAndLast;
console.log('setFullName:',this.fullName);
};
this.setFirstName = function(first) {
this.firstName=first;
console.log('setFirstName:',this.firstName);
};
this.setLastName = function(last) {
this.lastName=last;
console.log('setLastName:',this.lastName);
};
this.getFullName = function() {
console.log('getFullName:',this.fullName);
return this.fullName;
};
this.getFirstName = function() {
return this.fullName.split(' ')[0];
};
this.getLastName = function() {
return this.fullName.split(' ')[1];
};
return this.fullName;
};
var bob = new Person('Bob Ross');
console.log(bob.getFullName());
**Your browser information:**
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.128 Safari/537.36
.
Challenge: Make a Person
Link to the challenge: