printInstructions function

Ignore that for now. That’s on the next line and we aren’t there yet. :slight_smile:

I really can’t think of what should go there

You were on the right track with i < array.length[i]. There’s just one piece that should NOT be there. :slight_smile:

I think it should be array.length

then array[i] for console.

Correct! i < array.length will work!

Now we look at your last line: console.log("Step 1 - " + array)

Two things here.

  1. We need the Step 1 to change to Step 2 etc.
  2. We do not want to add the entire array, just one part of the array. @Darknez is correct here. :slight_smile:

console.log(array[i])

That’s good progress. Now how do you add the Step # - part to that?

1 Like

I haven’t done anything yet to cover that

Looking at the code you’ve put together so far, I think you have the knowledge to figure it out.
Right now we have Step 1 + array[i]. This means that every loop of your function will return Step 1 - and the value of the array in position i.
So array[i] will be something different for each loop, right? How do we get Step 1 to be different for each loop?

In the assignment, it said that at each step, the counter variable is one less than the step number. So whatever the variable is - step number

Do you know what your counter variable is?
Hint: It’s in the for loop conditions code

I think that would be let?

no… it would be array

You were close with let. let establishes the variable. Which variable is it establishing in that line?

so then it would be i

1 Like

Yes!
So now you need "Step" followed by i followed by "-" followed by your array[i] right?
Except, if i is your counter variable, and the assignment says the counter variable is one less than the step number, you need to account for that too.

Thanks, but that didn’t work either…

Just to make you aware, for future posts:

When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

Note: Backticks are not single quotes.

markdown_Forums

1 Like

Can you take a screenshot of your result and post it here. Because it worked for me.