Learned about Loops today
Loops
- are useful for repeating the same code multiple times.
- will often have slightly different code each time the loop runs, or the same code will run but with different variables.
Loops break Statement
- has similar utility to the break statement used in switch() conditionals
- is used to exit a loop before all iterations are complete and make the browser move on to any code that follows it.
Loops continue Statement
- is used to break or skip an iteration, if a specified condition occurs, and make the browser continuew ith the next iteration in the loop.
map() vs filter()
- map()in loops is used to modify items in a collection and create new collection containing the modified items -filter() modifies items in a collection and creates a new collection containing only the items that match
Tomorrow's Learning Plan
- for loops
- while and do loops
- MDN Active Learning Tasks in Loops
References
Top comments (0)