Learn Introductory JavaScript by Building a Pyramid Generator - Step 36 Solution

I spent almost an hour trying to complete this step, but all my efforts were in vain. Even with the help of AI (ChatGPT), the issue couldn’t be resolved. Finally, after taking a tea break, I resolve. It was a ; at the end of iteration

It turns out the problem wasn’t with the code logic, but possibly with the freeCodeCamp test case itself.

For example, the following code:

for (let i = 0; i < count; i = i + 1) {

}

wasn’t passing the test. However, after removing a semicolon (which technically shouldn’t make a difference), the test passed. I believe this might be a formatting-related issue in the test case.

I request the freeCodeCamp team to please review and improve such test cases, so that learners aren’t stuck due to minor formatting quirks. It can be frustrating and discouraging, especially for beginners.

Thank you!

Could you link to the step in question?

yes, here is the link : Learn Introductory JavaScript by Building a Pyramid Generator: Step 36 | freeCodeCamp.org

I’ve tried couple versions with and without the semicolon included, but I wasn’t able to encounter the one that wouldn’t pass.

If you still remember the culprit example, could you provide it?

here is the working solution bro.
for (let i = 0; i < count; i = i + 1) { }

Hmm… as far as I can tell, both

for (let i = 0; i < count; i = i + 1) {

}

and

for (let i = 0; i < count; i = i + 1) { }

Are passing the step 36…

1 Like

Yes, without semicolon is working for me

what is the version with the semicolon that is not working?

1 Like

OS: Windows 11
Browser: Microsoft Edge
Browser Version
141.0.3537.57 (Official build) (64-bit)

that is not the code with the semicolon that is not working, please share the version of the code with the semicolon that is not working

1 Like

Ok. here is the buggy code:
for (let i = 0; i < count; i= i + 1;) {

}

that is not a bug with the test runner, that is a syntax error, so it’s impossible to have that code pass

1 Like

Ok. Thanks for clarifying.