Learn Introductory JavaScript by Building a Pyramid Generator - Step 42

Tell us what’s happening:

hello!
In the for...of loop, how i can use the addition operator to concatenate the row value to the result value.

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) {

}

// User Editable Region


console.log(result);

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) 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 42

Hi Samuel,

You can look at the example given in the instruction as a reference:

hello = hello + " World"

The statement above use the addition operator to concatenate the string " World" to the hello value.

What we need to do is:

use the addition operator to concatenate the row value to the result value.

1 Like