Learn Introductory JavaScript by Building a Pyramid Generator - Step 41

Tell us what’s happening:

Tried every combination I can think of. I’m sure there’s overcomplication going on here but the formula for (const value of iterable) when followed here is not giving me a passing result. I tried const rows = (for rows of + 1) but it didn’t like that either and I felt like this was my best answers thus far.

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

const rows = (for of) {}

// User Editable Region


console.log(result);

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 Edg/127.0.0.0

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 41

Hi!

That is not correct Syntex for for...of loop.

See correct loophere:

for (const variable of iterable) {}

You need to iterates through the rows array. Use row variable for that iteration.

2 Likes