Might be a stupid question, but v what is the main purpose for looping in JS? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 4

Might be a stupid question, but v what is the main purpose for looping in JS?

16th May 2017, 3:57 PM
Kevin
Kevin - avatar
3 Respostas
+ 8
loops are usefull, if you want to run the same code over and over again, with a different value for each Iteration. with a loop you can iterate through an array and printout every value! or compare 2 Arrays to find Same values
16th May 2017, 4:14 PM
Cubensis
Cubensis - avatar
+ 3
A lots of purpose for using looping eg. ā€¢ prints all the array values ā€¢ check all same elements status ā€¢ update elements values ā€¢ add events listeners to all buttons ā€¢ iterate a list to find some text etc...
16th May 2017, 5:00 PM
CalviÕ²
CalviÕ² - avatar
+ 1
Thank you guys! I see now
16th May 2017, 5:33 PM
Kevin
Kevin - avatar