Learn Introductory JavaScript by Building a Pyramid Generator - Step 62

Tell us what’s happening:

This is my code.
function padRow(rowNumber, rowCount) {
return rowCount-rowNumber + character.repeat(rowNumber) + rowCount-rowNumber;

This is my error.
You should call .repeat() on your " " strings to repeat them 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/124.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 62

you have missig the space strings and .repeat() method , in the start and in the end.
instruction:
Update your blank space strings to be repeated rowCount - rowNumber times.

function padRow(rowNumber, rowCount) {
return " " + character.repeat(rowNumber) + " ".repeat(rowCount-rowNumber);
}
this is my code now but still i have an error

post your code, using three back tick (```) in a seperate line, below and above your code here.

  return " " + character.repeat(rowNumber) + " ".repeat(rowCount-rowNumber);
  ``` like this;
  return " " + character.repeat(rowNumber) + " ".repeat(rowCount-rowNumber);

but still not working

you also need repeat method for the strating space string. like you did in the end.

i am starting with this

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

your both space string " " should be same. above i mentioned the last one.

thanks a lot for helping me