"Iterate through an array with a for loop" checks forces you to use "var" cannot use "let" or "const"
See original GitHub issueChallenge Name
Issue Description
The challenge requires you to initialize a variable however it forces you to use var, rather than let or const.
Browser Information
- Browser Name, Version: Ungoogled Chromium
- Operating System: macOS
- Mobile, Desktop, or Tablet: Desktop
Your Code
N/A
Screenshot

Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Loops and iteration - JavaScript - MDN Web Docs
The for...of statement creates a loop Iterating over iterable objects (including Array , Map , Set , arguments object and so on), invoking...
Read more >javascript - Why is using "for...in" for array iteration a bad idea?
Using for (var property in array) will cause array to be iterated over as an object, traversing the object prototype chain and ultimately...
Read more >JS For Loop Tutorial – How to Iterate Over an Array in JavaScript
This article will provide you with a solid understanding of exactly how to iterate over an Array data structure in JavaScript.
Read more >Is it best to use "var" or "let" in for loop iterations or ... - Reddit
In a for-of loop, const does work to store the list item in our current iteration. It's essentially scoped to each iteration, so...
Read more >5. Working with Arrays and Loops - JavaScript Cookbook [Book]
For instance, if you create an array literal, you can use commas to delimit array elements that don’t yet exist: var arrLiteral =...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think I incline towards adding support for
let
. But it doesn’t have to be explicit or obvious, even in the test message. As long as we can keep that I am okay to update the tests.It is looking for a specific solution that uses the var keyword.
As a side note, a lot of the beginning javascript challenges force you to use var. I am pretty sure this is by design.