Learn Introductory JavaScript by Building a Pyramid Generator - Step 39

Tell us what’s happening:

How can l 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) {
  
}
result = result + "row";

// User Editable Region


console.log(result);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 39

The example given in the instructions demonstrates how you could concatenate a string onto an existing variable.
However, row is not a string but a variable, so should not have quote marks around it.

Hi there! row is a variable, not a string

thank you, it has passed

1 Like

thank you, it has passed

1 Like