Chapter 4. Loops
LOOPS ALLOW US to repeat lines of code until a certain set of conditions are met. Itâs another simple concept on the surface, but one that allows us to do a surprising amount of work.for
Youâll use for
loops in situations where youâll be running a loop for a known number of times, or iterations. (By âknown,â I donât mean that we, the brains between the keyboards and chairs, necessarily know how many times weâll need to go through a loop in advance; I just mean that weâll be looping through a known quantity.)
The syntax for a loop is a little tricky, since weâre packing a lot of information into just a few ...
Get JavaScript for Web Designers now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.