Learn Introductory JavaScript by Building a Pyramid Generator - Step 62

Tell us what’s happening:

you should call .repeat() on your two " " strings

Your code so far

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

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


// User Editable Region

function padRow(rowNumber, rowCount) {
  const spaces = "·".repeat(rowCount - rowNumber); 
    return spaces + character.repeat(rowNumber * 2 - 1) + spaces;
}

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

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 62

Hi @rautraokailas17 !

Welcome to the forum!

Your issue is here

the directions say to use repeat on your spaces.
not a string with a dot in it

But also, with the current tests, it doesn’t account for creating a variable like this

For passing the tests right now, I would suggest resetting the lesson and modifying this line directly without creating any variables

return " " + character.repeat(rowNumber) + " ";

also, I have created an issue for this since there are multiple correct answers for this