Skip to content

Latest commit

 

History

History

classes2

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

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