Learn Introductory JavaScript by Building a Pyramid Generator - Step 69

Tell us what’s happening:

i dont understand the question. WHat should i do? should i fiill the blank space strings or where to fill rowcount-rownumber times?

Your code so far

const character = "#";
const count = 8;
const rows = [];


// User Editable Region

function padRow(rowNumber, rowCount) {
  return "rowCount - rowNumber" + character.repeat(rowNumber) + "rowCount - rowNumber";
}

// User Editable Region


for (let i = 0; i < count; i = i + 1) {
  rows.push(padRow(i + 1, count));
}

let result = ""

for (const row of rows) {
  result = result + "\n" + row;
}

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/126.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 69

you need to add the repeat function on the space string so that the space is repeated rowCount - rowNumber times

1 Like

how? im tried and nothing change. Can u show me the example of it

can you show me what you tried

function padRow(rowNumber, rowCount) {
return character.repeat(rowCount - rowNumber) + character.repeat(rowNumber) + character.repeat(rowCount - rowNumber);
}

you are concatenating the character string multiple times, where are the strings with a single space inside? I don’t see them anymore

i delete it. i try something

are u mean like this, sorry for the late respon. ive been stress out learning this

thanks bro ur are very helpful. I have finished the step 69

Very helpful, thank you ilenia! Frustrating how something so simple can completely befuddle me. Always a beginner.