Learn JavaScript: Scopes issue


#1

Hey guys,
It’s been two years since I have learned JS, and I have forgotten everything. I have been trying to relearn just this year.

I have an issue with the Scopes lesson. At step 4 or exercise 6, they tell me to make a for loop. Since Scopes is Lesson 4, I checked and saw that Loops was still at Lesson 6. Thus, leaving me with no clue what a for loop is.

Any help will be appreciated. Thanks.
Gerard


#2

Take a look at this page for some basic info.

The for loop is designed to iterate a process a certain number of times, often changing functions inside the loop based off the current iteration number.

JavaScript syntax:

for (i = 0; i < 5; i++) {
    text += "The number is " + i +;
}
console.log(text);

#3

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