11 - Javascript Control Flow
11 - Javascript Control Flow
Javascript
Control Flow
Content
Conditional Statement
Conditional
Statement
© 2024 Celerates
1
CELERATES.CO.ID
Conditional Statement 2024
If statement
Else if
Else if
Else if
Nesting
We can nest conditionals inside conditionals
Switch Case
Use switch to specify many alternative blocks of code to
be executed
Break statement
Looping and
Iteration
REPEAT STUFF.
REPEAT STUFF.
REPEAT STUFF.
© 2024 Celerates
2
CELERATES.CO.ID
2024
Loops
For Loops
Infinite Loops
Nested Loops
For of
A nice and easy way of iterating over
arrays
(or other iterable objects)
For of
An Example
For in
For in
An Example
//John Doe 25
While Loops
Do … While Loops
Do … While Loops
Do … While Loops
An Example
Any question?
GUIDING RESOURCE
Loops and iteration - JavaScript | MDN (mozilla.org)
https://egghead.io/
https://www.javatpoint.com/