Learn Introductory JavaScript by Building a Pyramid Generator - Step 63

Tell us what’s happening:

I am on thi step now which I am stuck on. I want some help pls so I can move on.

Your code so far

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


// User Editable Region

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

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

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 63

  • wrong usecase of ""
  • you need to add “two blank space”, one at beginning and another at end
  • look at example given for how to add a “blank space”

happy coding :slight_smile:

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

the space has to be added inside the return statement, not after

this is the return statement, anything below this has no effect

ok how do i do that i have tried it using the example

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

It’s incorrect because you have to add (concatenate) a string with space " " at the beginning of the return value.
You have to do nothing with “padRow()” at the end, so remove it. Also remove the empty string from the end and put it just after the return keyword and put a space in the quotes. Then add it to the character.repeat(rowNumber).

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

You have to add a string with a space " " at the start and at the end of character.repeat(rowNumber).

“” return character.repeat(rowNumber) “”;

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

After return keyword, use one string with space " ". Use + sign and after that use character.repeat(rowNumber). Use + sign again and use one string with space " ".

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

You are using the string before the return keyword. Remove it and use it " " after the return keyword. Like this: return " " + then rest of your code.

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

Yes this one is correct :smiley:.

it does not work tho

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

Check again, refresh the browser. I have cheked your code in my browser. It’s working.

no still not working

I think that the last quote is resulting in error. It’s looking different from the first one. Try using " " this one. Don’t forget to use space.