Learn Introductory JavaScript by Building a Pyramid Generator - Step 35

Tell us what’s happening:

Replace your log statement with a statement to push i to your rows array.
I’m not sure what the ‘log statement’ is

Your code so far

// User Editable Region

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

}

// User Editable Region

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


// User Editable Region

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

// User Editable Region

###On the console
// running tests
You should call .push() on your rows array.
You should push i to your rows array.
Your .push() should happen in your for loop.
// tests completed

Your browser information:

User Agent is: Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 35

Welcome to the forum.

This is the log statement:

  console.log(i);

You need to replace it with:

a statement to push i to your rows array.

1 Like

I’m struggling with the statement to push i into rows array myself

@lyonking1991
There are some hints in the output in the console on the right:

You should call .push() on your rows array.
You should push i to your rows array.
Your .push() should happen in your for loop.

1 Like

I actually just figured it out, I was thinking to hard on it at first. Thank you for the feedback though, it is greatly appreciated.

1 Like

same here. Plus a syntax error gave me a giant headache until the lightbulb went off

In the future, please create your own topic when you have specific questions about your own challenge code. Only respond to another thread when you want to provide help to the original poster of the other thread or have follow up questions concerning other replies given to the original poster.

The easiest way to create a topic for help with your own solution is to click the Help button located on each challenge. This will automatically import your code in a readable format and pull in the challenge url while still allowing you to ask any question about the challenge or your code.

Thank you.