Step 36 Learn Introductory JavaScript by Building a Pyramid Generator

I’ve attempted every solution given here and looked online. Nothing seems to be working. I’ve tried every value available at this point. my code is below I left the space for the const value blank as I could never come to a conclusion. If any other errors are present please feel free to state them as well

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

let result = ""

for (const   of rows){

}

console.log(result)

Please post a link to the step. Thanks

This definitely isn’t valid syntax, you need something after const

you obviously didn’t read my post as I said I left it blank purposely

Sure, but that’s obviously not right, so can you put what you think should go there? Also, can you post a link to the step?

I don’t know, that’s the point

Can you share some of the things you tried?

I’ve used every value present in the initialized elements: 0-8 as far as numbers even the i = i +1. nothing tests. tried the array name and all

Can you show the code you tried? Also, can you link to the step?

Numbers definitely are not valid variable names, so that won’t work there.

just leave it. you’re being obtuse and I don’t have time to deal with you. I’ll keep looking on my own because either you know or you don’t. if you have to figure it out too then no help to me. thanks anyway

I’m not being obtuse. We cannot write the solution for you, so we really actually need the code you tried and a link to the step! If you provide the link and the full code you tried, its actually pretty easy for us to help you quickly.

Hey, I found the secret link to the step!


None of this is what the step asked for, so it has to go.

Original code:

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

}

Instructions:

Inside the body of the loop, print the value of the i iterator and see what happens.

The “body of the loop” is the part with the {}

In there you have

But that’s not “print the value of the i iterator”. push doesn’t print anything. You need to use JavaScript’s function for printing to the console, and tell it to print the value of i.


This is why providing the link to the Step is important! We don’t have all of the steps memorized, so I had no way of knowing what was going on without wasting both of our time hunting down the link.

1 Like

That’s not correct for Step 36

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.