| 50 | console.log(Person.favoriteSkill()) |
| 51 | |
| 52 | class Student extends Person { |
| 53 | constructor(firstName, lastName, age, country, city, gender) { |
| 54 | super(firstName, lastName, age, country, city) |
| 55 | this.gender = gender |
| 56 | } |
| 57 | |
| 58 | saySomething() { |
| 59 | console.log('I am a child of the person class') |
| 60 | } |
| 61 | getPersonInfo() { |
| 62 | let fullName = this.getFullName() |
| 63 | let skills = |
| 64 | this.skills.length > 0 && |
| 65 | this.skills.slice(0, this.skills.length - 1).join(', ') + |
| 66 | ` and ${this.skills[this.skills.length - 1]}` |
| 67 | |
| 68 | let formattedSkills = skills ? `He knows ${skills}` : '' |
| 69 | let pronoun = this.gender == 'Male' ? 'He' : 'She' |
| 70 | |
| 71 | let info = `${fullName} is ${this.age}. ${pronoun} lives in ${this.city}, ${this.country}. ${formattedSkills}` |
| 72 | console.log(this) |
| 73 | return info |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | const s1 = new Student( |
| 78 | 'Asabeneh', |
nothing calls this directly
no outgoing calls
no test coverage detected