Learn Introductory JavaScript by Building a Pyramid Generator - Step 42

Tell us what’s happening:

I have solved this but the problem is I cannot fix it

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 (let row of rows) {

result = rows +" row";

}

console.log(result);

// User Editable Region



Your browser information:

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

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 42

The step says

concatenate the row value to the result value.

But in your code:

You concatenated rows (not row) to the string “row” not the variable result.

Please reset and retry

1 Like

I tried but, does not change at all

Hi,
your output in this step should be a string that looks like this: 01234567.
The only variables needed for this concatenation are result and row.
Hope this helps:)

3 Likes

Ok thank you. I get it and solved it :heart:

2 Likes

please don’t post your solutions on the forum. thanks.

1 Like

Sorry getting to excited

1 Like

this is correct answers:

Mod edit: code removed

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.

use row instead of using “row” because in example they use “world” it was a string but here we use array so no need of use quotes