Basic JavaScript: Iterate with JavaScript For Loops


Either I’m missing something obvious or the validation for this lesson isn’t quite right.

The test result I’m seeing is “You should be using a for loop for this.” despite my code matching the given solution on the hints page (I even pasted that solution in to sense-check what I was seeing).

Code below:
for (var i = 1; i < 6; i++) {

(I’m finding the site really helpful, thanks to all involved)

Can you mention the question?

Try asking the question again with the code included.

please include challenge link and your code correctly formatted
next time you could use the “Ask for help” button that will create the post will all the infos already included

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.



I’m getting the same error with all of the “for-loop” lessons in Basic JavaScript. For example:

Basically, I’m using a “for loop” method in my code (as far as I can tell. It matches the given solution under the hint and is written in-line with that lesson’s example) but the validation is telling me I’m not using a “for loop”.

If you paste the official solution from the “get hint” page into the lesson, you should see what I mean (if you’re seeing what I’m seeing).

Kind regards.

Hi, I’m having exactly the same problem on Iterate with Javascript For Loops. Although my code gave me a tick for “myArray should equal [1,2,3,4,5]” it still tells me I should be using a for loop, even after clearly doing so and also copy-pasting the solution given as correct in the forum. Glad to hear it’s probably a technical fault and not just me ‘not getting it’ -will try and skip to the next portion of the course

It’s a bug. Will be resolved soon.

Kindly continue with the other exercises.