JavaScript JavaScript Loops, Arrays and Objects Simplify Repetitive Tasks with Loops A Closer Look at Loop Conditions

Guadalupe Favela
Guadalupe Favela
5,986 Points

Counter

Is "Counter" a JavaScript keyword for counting loops, or was it just a variable name in the example?

2 Answers

Steven Parker
Steven Parker
173,876 Points

"Counter" is not a language keyword. But it is "best practice" to choose variable names that relate to the purpose the variable is used for, so this is a good example of a well-chosen variable name.

Eyanjem Etta-Ashu
Eyanjem Etta-Ashu
Full Stack JavaScript Techdegree Graduate 18,258 Points

It was a variable name. Choosing a variable name that matches the action performed is best practice.