Skip to content

Latest commit

 

History

History
26 lines (19 loc) · 526 Bytes

README.md

File metadata and controls

26 lines (19 loc) · 526 Bytes

CLASSES EXERCISE

recreate this family with code, On every person i need to be able to ask what are you. With a function on this person called getRelationTitle(person)

tip:

  • Use classes

Maybe use this?

class Person {
    constructor(){
        this.parents = [];
        this.children = [];
    }

    getRelationTitle(person){
      // i need to return my title related to that person, example like. parent, grandparent, GreatGrandParent, Child etc.
    }
}

Good Luck