Switch order of 'Basic Javascript' for- and while-loop lessons
See original GitHub issueChallenge Name
Iterate with JavaScript For Loops Iterate with JavaScript While Loops
Issue Description
Consider moving the lesson “Iterate with JavaScript While Loops” to a position before the series of lessons on for-loops, starting at “Iterate with JavaScript For Loops”. Currently the single while-loop lesson is placed after the for-loop lessons, but it may be advantageous for students if its made clear that a for-loop is a condensed form of a while loop (especially since the example code in the lessons are synonymous:
var ourArray = [];
var i = 0;
while(i < 5) {
ourArray.push(i);
i++;
}
and:
var ourArray = [];
for (var i = 0; i < 5; i++) {
ourArray.push(i);
}
Lesson text in the for-loop lessons could then be updated to make the relationship to while-loops more explicit. It could also be stated that while-loops are used for more than just iterating but if you find yourself iterating with a while-loop, that’s a good opportunity to use a for-loop instead.
Screenshot
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (5 by maintainers)
Top GitHub Comments
Sounds reasonable to me
cc @FreeCodeCamp/issue-moderators
Working on it 😁