Akeem
April 3, 2026, 8:36pm
1
Tell us what’s happening:
When new ProjectIdeaBoard(“Empty Board”) is empty, emptyBoard.formatToString() should return Empty Board has 0 idea(s)\n. I can’t get this to pass no matter what I do.
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(obj){
this.ideas.push(obj);
}
unpin(obj){
const objIndex = this.ideas.findIndex((item)=> item.title === obj.title && item.description === obj.description);
if(objIndex === -1){
alert("this project idea doesn't exist")
return
}
this.ideas.splice(objIndex, 1);
}
count(){
return this.ideas.length
}
formatToString(){
let returnStr = `${this.title} has ${this.count()} idea(s)\n`;
if(this.count() === 0){
return returnStr;
}
this.ideas.forEach((obj)=>{
returnStr +=`${obj.title} (${obj.status.description}) - ${obj.description}\n`;
})
return returnStr;
}
}
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36
Challenge Information:
Build a Project Idea Board - Build a Project Idea Board
Hey @Akeem ,
I’ve opened an issue in Github about this. Your return string is correct and matches what the step expects.
opened 10:01PM - 03 Apr 26 UTC
scope: curriculum
status: waiting triage
### Describe the Issue
A user on the FCC forums posted about not being able to … pass step 17. This seems to be related to #57880 and #57886. Their return statement matches the story of Step 17, yet they cannot pass beyond this step. I have tested myself, and the characters used exactly match what should be in this step.
The affected method is `formatToString` within the `ProjectIdeaBoard` class.
### Affected Page
https://www.freecodecamp.org/learn/javascript-v9/lab-project-idea-board/build-a-project-idea-board
### Your code
```
class ProjectIdeaBoard {
constructor(title) {
this.title = title;
this.ideas = [];
}
pin(projectIdea) {
this.ideas.push(projectIdea);
}
unpin() {
this.ideas.pop();
}
count() {
return this.ideas.length;
}
formatToString() {
const count = this.count();
if (count === 0) {
return `${this.title} has 0 ideas\n`;
}
const projectIdeas = this.ideas
.map((idea) => idea.toString())
.join('');
return `${this.title} has ${count} idea(s)\n${projectIdeas}`;
}
}
```
### Expected behavior
The `formatToString` method should return: `${this.title} has ${this.count()} idea(s)\n` i.e. in the "Check Your Code" validation pop-up it says,
> When new ProjectIdeaBoard("Empty Board") is empty, emptyBoard.formatToString() should return `Empty Board has 0 idea(s)\n`.
### Screenshots
<img width="1896" height="888" alt="Image" src="https://github.com/user-attachments/assets/db189c68-f911-4670-9729-a266142cd4a7" />
### System
- Device: Laptop
- OS: Windows 11 Pro
- Browser: Google Chrome
- Version: 146.0.7680.165
### Additional context
_No response_
Akeem
April 4, 2026, 1:52am
3
ok, thank you. It just doesn’t make sense because test 18 is passing so I’m not sure why 17 would fail.
I spent easily 30 minutes because I thought I was going crazy, but your code exactly matches the expected output and is in a format that would be suitable for this project. This isn’t the first issue with this project and this particular step I found out, as well. I’ll come back here and reply when I have more answers. Until then, I would move on to other things until this is fixed.
There was a comment on the issue that says that removing the alert from the unpin causes step 17 to pass. So, there is still something wrong with this step processing, but just so you can move on, comment out/remove the alert in the unpin function.
unpin(obj){
const objIndex = this.ideas.findIndex((item)=> item.title === obj.title && item.description === obj.description);
if(objIndex === -1){
//comment out the line below
//alert("this project idea doesn't exist")
return
}
this.ideas.splice(objIndex, 1);
}
Akeem
April 4, 2026, 11:51pm
6
Nice! your suggestion did the trick. much appreciated.
1 Like