Tell us what’s happening:
Code is failing tests 17 and 18 despite it working in the console.
Your code so far
const projectStatus = {
PENDING: {description: "Pending Execution"},
SUCCESS: {description: "Executed Successfully"},
FAILURE: {description: "Execution Failed"}
}
class ProjectIdea {
constructor(title, description) {
this.title = title;
this.description = description;
this.status = projectStatus.PENDING;
}
updateProjectStatus(newStatus) {
this.status = newStatus;
}
}
class ProjectIdeaBoard {
constructor(title) {
this.title = title;
this.ideas = [];
}
pin(idea) {
this.ideas.push(idea);
}
unpin(idea) {
this.ideas.splice(this.ideas.indexOf(idea), 1);
}
count() {
return this.ideas.length;
}
formatToString() {
let formattedString = `${this.title} has ${this.count()} ideas(s)\n`;
this.ideas.forEach((idea) => {
formattedString += `${idea.title} (${idea.status.description}) - ${idea.description}\n`
})
return formattedString;
}
}
const ideaBoard = new ProjectIdeaBoard("Tech Projects Board");
const homeSystem = new ProjectIdea("Smart Home System", "An integrated system to control lighting, temperature, and security devices remotely.");
ideaBoard.pin(homeSystem);
console.log(ideaBoard.formatToString());
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:148.0) Gecko/20100101 Firefox/148.0
Challenge Information:
Build a Project Idea Board - Build a Project Idea Board