JavaScript by Building a Pyramid Generator Step 43

I’ve concatenated the row variable to the result, and I added a space (+\n+) but it’s not passing

const character = “#”;

const count = 8;

const rows = ;

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

rows.push(i);

}

let result = " ";

for (const row of rows)

{

result=result + “\n” + row;

}

console.log(result);

You have the sequence wrong. In the instructions it says to put the new line after the result and row values not in between.

1 Like

Thank you, sir it helped!
The code
let result = “”
for (const row of rows) {
result = result + row + “\n”;
}

1 Like