Learn Introductory JavaScript by Building a Pyramid Generator - Step 65

Tell us what’s happening:

So, I got this scenario where they ask for this:

// running tests
You should use the .repeat() method.
You should use the .repeat() method on your character variable.
You should pass rowNumber to your .repeat() call.
You should use the return keyword.
You should return the result of your .repeat() call.
// tests completed
// console output

I type up this in retunr:

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

And they still keep asking

Your code so far

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


// User Editable Region



// User Editable Region



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

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

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 65

Welcome to the forum @darstol

Here is a comparison of the original code and your code.

The code in blue is the original code, the code in red is your code.
The code in magenta is the overlap.

image

Your code does not appear to contain the padRow function.

Please reset the step to restore the original code and try again.

Happy coding

I am not seeing any code in red on my screen. Am I missing something here? Just blue and purple stuff on my end. Where is this padRow thing is coming from?

you have created padRow() function in the previous challenge steps. for we can assist, post your updated code here.

Hi @darstol

When your code (red) is laid over the original code (blue) it shows as magenta.

The padRow function was present in the editor when you started the challenge.

I think I got lost with this stuff. Need to come back at some point.