Guys i could really use some assistance, pls help. My for… of loop seems to me identical to the example given, i just don’t understand what concatenate means and how i can apply it here. Also, my result string is empty as of now, so how can i concatenate when i haven’t initialised result variable?! Hope my question makes sense.
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) {
row = row + result;
}
// 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/126.0.0.0 Safari/537.36
Challenge Information:
Learn Introductory JavaScript by Building a Pyramid Generator - Step 42