+ 4
Might be a stupid question, but v what is the main purpose for looping in JS?
3 Réponses
+ 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
+ 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...
+ 1
Thank you guys! I see now