Skip to content

Instantly share code, notes, and snippets.

@aldraco
Last active August 29, 2015 14:16
Show Gist options
  • Save aldraco/058d4837dfd1fbf5fcef to your computer and use it in GitHub Desktop.
Save aldraco/058d4837dfd1fbf5fcef to your computer and use it in GitHub Desktop.
make a person bonfire FCC (WIP) - TODO does not pass instance of Person test.
var Person = function(firstAndLast) {
//private variables
var name = firstAndLast;
var firstName = name.split(' ')[0];
var lastName = name.split(' ')[1];
//updated to pass the bonfire test
this.getFullName = function() {
return name;
};
this.getLastName = function() {
return lastName;
};
this.getFirstName = function() {
return firstName;
};
this.setFullName = function(input) {
name = input;
};
this.setFirstName = function(input) {
firstName = input;
};
this.setLastName = function(input) {
lastName = input;
};
};
var bob = new Person('Bob Ross');
console.log(Object.getPrototypeOf(bob));
bob.getFullName();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment