+ 1
Pls help me fix the errors and show me each error and how you were able to fix it.
I want to output the return "statement" in class classMate https://code.sololearn.com/WuoXAIai8gFh/?ref=app
2 odpowiedzi
0
//Missing } on line no 20
//now it is not showing any errors
class students{
constructor (fn,ln,cls){
this.firstName = fn
this.lastName = ln
this.cls = cls
}
showDetails(){
return `my name is ${this.firstName} ${this.lastName} i am in ${this.cls}
`}
}
class classMate extends students{
constructor(fn,ln,cls,age){
super(fn,ln,cls)
this.age = age
}
show(){
return `${this.showDetails()} and ${this.age}`
}
}
myClassMate = new classMate("uche", "kalu", "js 2", "40 years")
console.log("myClassMate")
0
@Rohit Pratap, thank you so much, but the output is not what I expected to see. I expect to see the arguments passed into the class classMate