Tag: code-flow
-
[Javascript] Controlling code flow (2)
Labeled Statement Labeled statements in JavaScript provide a mechanism for identifying and referencing specific statements within your code. While not frequently used, they can be particularly useful in certain scenarios, such as when working with nested loops or when you need to break out of multiple control structures. Why Do We Need Labels? Labels are…
-
[Javascript] Controlling code flow (1)
Controlling code flow Conditional statement When controlling the flow of our code, we have several options. If we want to execute different blocks of code based on certain conditions, we can use if-else statement. These statements allow us to specify which code block should be executed based on carefully defined conditions. Below, we see see…