> For the complete documentation index, see [llms.txt](https://eleven-fifty-academy.gitbook.io/javascript-152-objects-arrays/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://eleven-fifty-academy.gitbook.io/javascript-152-objects-arrays/04-objects/solutions/constructor-function/person-constructor.md).

# Person Constructor

## Completed Code

```javascript
function Person(firstName, lastName, gender, age, birthday) {
    this.firstName = firstName;
    this.lastName = lastName;
    this.gender = gender;
    this.age = age;
    this.birthday = birthday;
    this.nextYear = this.age + 1;
    this.fullName = function () {
        return (this.firstName + " " + this.lastName);
    };
    this.pronoun = function () {
        if (this.gender.toLowerCase() === 'male') {
            return "He";
        } else if (this.gender.toLowerCase() === 'female') {
            return "She";
        } else {
            return "They";
        }
    };
    this.possessive = function () {
        if (this.gender.toLowerCase() === 'male') {
            return "his";
        } else if (this.gender.toLowerCase() === 'female') {
            return "her";
        } else {
            return "their";
        }
    };
    this.ordinalSuffix = function (i) {
        var j = i % 10,
            k = i % 100;
        if (j == 1 && k != 11) {
            return i + "st";
        }
        if (j == 2 && k != 12) {
            return i + "nd";
        }
        if (j == 3 && k != 13) {
            return i + "rd";
        }
        return i + "th";
    };
}

var person1 = new Person('Bob', 'Smith', 'male', 35, 'March 4');
console.log(person1);
console.log(person1.fullName());
console.log(person1.pronoun());
console.log(person1.nextYear);
console.log(person1.ordinalSuffix(person1.age));
```

## Output

```javascript
Person {
  firstName: 'Bob',
  lastName: 'Smith',
  gender: 'male',
  age: 35,
  birthday: 'March 4',
  nextYear: 36,
  fullName: [Function],
  pronoun: [Function],
  possessive: [Function],
  ordinalSuffix: [Function] }

Bob Smith
He
36
35th
```

We'll look at all of this in the next section.
