Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Make a Person] has a bug #632

Open
Kenvas opened this issue Jul 28, 2019 · 0 comments
Open

[Make a Person] has a bug #632

Kenvas opened this issue Jul 28, 2019 · 0 comments

Comments

@Kenvas
Copy link

Kenvas commented Jul 28, 2019

Challenge Make a Person has an issue.
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0.
Please describe how to reproduce this issue, and include links to screenshots if possible.

My code:

var Person = function(firstAndLast) {
    var firstName="";
    var lastName="";
    this.getFirstName=function(){
        console.log('getFirstName',firstName);
        return firstName;
    };
    this.getLastName=function(){
        console.log('getLastName',lastName);
        return lastName;
    };
    this.getFullName=function(){
        var retval=[firstName, lastName].join(' ');
        console.log('getFullName',retval);
        return retval;
    };
    this.setFirstName=function(x){
        console.log('setFirstName',x);
        firstName=x;
    };
    this.setLastName=function(x){
        console.log('setLastName',x);
        lastName=x;
    };
    this.SetFullName=function(x){
        var arr=x.split(' ');
        console.log('SetFullName', arr);
        firstName=arr[0];
        lastName=arr[1];
    };
    this.SetFullName(firstAndLast);
    return this;
};

var bob = new Person('Bob Ross');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant