Learn Introductory JavaScript by Building a Pyramid Generator - Step 68

Tell us what’s happening:

please I am confused as to how to continue this step

Your code so far

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


// User Editable Region

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

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

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 68

Hi there!

Reset the challenge step and try to repeat the " " space strings rowCount - rowNumber times . Like you did repeat the character variable in early challenge step, I mentioned above.

so you are saying i should reset my whole step

Reset the challenge step mean only current step.

I have reset it. so how do i put the space strings.

you write a space string like " ", you need to use the .repeat() method to repeat it multiple times

1 Like

I have done that what do I do next

what have you written?

You have done that on your device, we can’t see what you did

“”.repeat(); this was what I wrote

what’s the rest of the line? also you need to put the value you are asked to use between ()

i dont know what value

sorry, in this step you need only to add a space string at beginning and end of the returned string, no need to use .repeat() in this step

Once resolve this, do let me know the final output, as i am facing the same issue.

hey @Meenakshi001

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Ask for Help button located on the challenge (it looks like a question mark). This button only appears if you have tried to submit an answer at least three times.

The Ask for Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.

I am still stuck. Please I need help :sob: :sob:

what have you written for this step?

Please add your updated code

When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

"" return ""("character");
}

this is the code i wrote

you need to use concatenation to add a single space before character and a single space after character. This all needs to happen in front of the returnstatement

return /* change things here to the right of the return */