+ 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