Tell us what’s happening:
Any help would be appreciated. I don’t know what I’m doing wrong I tried every thing I can think of but I still can’t solve it. it says that I need to use the .repeat( ) method in the .push( ) method and I don’t know what to do I tried using commas, semicolons and nothing seems to work.
Your code so far
const character = "#";
const count = 8;
const rows = [];
// User Editable Region
for (let i = 0; i < count; i = i + 1) {
rows.push(character);
character.repeat(i);
}
// User Editable Region
let result = ""
for (const row of rows) {
result = result + row + "\n";
}
console.log(result);
Challenge Information:
Learn Introductory JavaScript by Building a Pyramid Generator - Step 45