Learn Introductory JavaScript by Building a Pyramid Generator - Step 43

Tell us what’s happening:

I dont understnad what i am doing wrong . i think i only needed to add +“\n”
Error: " You should assign the entire concatenation back to your result variable. Don’t forget your semicolon."

Your code so far

const character = "#";
const count = 8;
const rows = [];

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

let result = ""


// User Editable Region

for (const row of rows) {
  result = result + "\n" + row ;
}

// User Editable Region


console.log(result);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 43

1 Like

if i use this
result = result + “\n” + row;
it works
but if i use this //if there is a space before semicolon it doesnt work
result = result + “\n” + row ;
it doesnt work
i think its bug

1 Like

i’m not sure what is happening there but please report it here:

Thank you for helping make FCC better. Bugs can be reported as GitHub Issues. Whenever reporting a bug, please check first that there isn’t already an issue for it and provide as much detail as possible.

1 Like

Don’t put a space before the semi-colon.

It may or may not be related to fCC using “strict mode” JS but also it’s just not good standard JS.

Semicolons must have a space after and no space before.

https://standardjs.com/rules.html

Try to be consistent in style and generally do what everyone else does because it makes your code easier to read for everyone else.

1 Like

please let me know if you will go ahead an open an issue or not. We need to track this as other testcases do not care about the semi-colon and so for the consistency of the UI we should get this testcase fixed to match. (I will open the issue if you don’t want to do it)

2 Likes

I am not entirely sure how to properly open the issue. If you could do it, that would be greatly appreciated.

Thank you for your assistance.

1 Like

There is a great guide for this here: https://www.freecodecamp.org/news/how-to-report-a-bug-to-freecodecamp/

1 Like

here’s the new issue, thanks for your report:

2 Likes