Learn Introductory JavaScript by Building a Pyramid Generator - Step 68

Tell us what’s happening:

Hi I can seem to understand the question someone should help me out here

Your code so far

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


// User Editable Region

function padRow(rowNumber, rowCount) {
  return character.repeat(rowCount) + character.repeat(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/125.0.0.0 Safari/537.36 Edg/125.0.0.0

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 68

Hii future developer,
Its a good question (it took me to understand for like 20-25minutes)
Here we go,

MOD EDIT: Solution removed.

[i hope it will helps you]

Hi there!
Posting full working code is not allowed here on the forum.

okay sir
Next time, i will show case much better.

1 Like

hi cant see your solution

Hi there!
Giving full working code solution is not allowed here on the forum. We can help you by giving hints or suggestions only.

The challenge step is asking you to repeat your both space strings (" ") rowCount - rowNumber times using .repeat() method.
Example

Str.repeat(times)

Hi fellow coder,

I also was having issues.

Try using the " " with a space in between at the beginning and end of your return statement. Make sure to use the + operator in between the return statement as well.

I hope this helps without breaking any FCC forums rules.

1 Like