Learn Introductory JavaScript by Building a Pyramid Generator - Step 42

Tell us what’s happening:

i’m stuck, i need help on the next line of code…

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 =+ " row";}

// User Editable Region


console.log(result);

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 42

row and result are both variables which contain values. You want the value stored in the variable so you should not use a string with quotes.

the addition operator

This is the addition operator: +

Look at the example again:

For example, hello = hello + " World"; would add the string " World" to the existing string stored in the hello variable.

You want to combine (concatenate) the variables of two variables:

var1 = var1 + var2;