Tell us what’s happening:
I dont really like that im posting for help for TWO in a row…
personal thing… buuuut…
am i just breaking a semantic somewhere…
or have i been i way over assuming the “elasticity” of the foundation i base my confidence in…
aaand i actually just DONT GET what is “getting/setting”
… or have i been completely misreading the problem here?
const Person = function(firstAndLast) {
let full = firstAndLast;
this.getFirst = function(){
return full.split(" ")[0];
}
this.getLast = function(){
return full.split(" ")[1];
}
}
this.getFull = function() {
return full;
};
this.setFirst = function(name) {
full = name + " " + full.split(" ")[1];
};
this.setLast = function(name) {
fullName = full.split(" ")[0] + " " + name;
};
this.setFull = function(name) {
full = name;
};
const bob = new Person('Bob Ross');
console.log(bob.getFullName())
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36
Challenge: Intermediate Algorithm Scripting - Make a Person
Link to the challenge: