Mi solución, solo use template literals y el metodo join(). Aprendí mucho en este curso.
import { Comment } from "./Comment";
import { Student } from "./Student";
export class TeacherStudent extends Student{
constructor(props, skills=[]) {
super(props);
this.skills = skills;
}
publicarComentario(commentContent) {
const role = `profesor de ${this.skills.join(",")}`;
//console.log(role);
const comment = new Comment({
content: commentContent,
studentName: this.name,
studentRole: role
});
return comment.publicar();
}
}
Want to see more contributions, questions and answers from the community?