Control Flow

This lesson introduced JavaScript control flows that are similar to those of other languages, such as if/else statements, comparison operators, and switch statements. These have nearly the same functionality and syntax as other languages such as PHP or Java, and can be used to make different decisions as the code executes. The following image is an example of a switch control flow: if we were to add a line that read console.log(moonPhase);, it would see that moonPhase is set to 'full' and execute the appropriate statement. In this case, the output would be "Howwwwlll!!"