Learn Introductory JavaScript by Building a Pyramid Generator - Step 66

Tell us what’s happening:

Please explain to me how this is not exactly what it said to do.

Your code so far

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

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



// User Editable Region

for (let i = 0; i < count; i = i + 1) {
  rows.push(padRow)
  padRow();
}

// User Editable Region


let result = ""

for (const row of rows) {
  result = result + "\n" + row;
}

console.log(result);

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 66

A function is called by referencing the function’s name, and adding (). Here’s how to call a test function:

Example Code

test()
2 Likes

Add a padRow call to your row.push();. Remove any extras you added.

1 Like

So you technically try calling rows.push by manipulating padRow? Or just the other way around? I tried playing around with this, but keep getting stuck. Any suggestions?

Hi there!

Create a topic to the challenge step using Help button in the challenge editor.