Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions study-guides/conditionals.md
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
# Conditionals
We make decisions everyday from what to eat, what to do first when we wake up, etc. In order to do this we often ask ourselves simple yes or no questions to make decisions. In order to help computers make decisions, we use **conditional statements** to tell the computer what to do at various points in our program.

**Conditional statements** are programming commands that are used to handle decisions and control program flow. We use the keywords `if` and `else` to define a conditional statement in JavaScript. Conditional statements in JavaScript follow a similar syntax as conditional statements in Java

4. The keyword `else`.
5. Another set of curly braces, inside which we have some more code — this can be any code we like, and it only runs if the condition is not `true` — or in other words, the condition is `false`.

In summary, conditional statements allow us to create a decision-making process in our programs, where different actions can be taken depending on whether a condition is true or false.

Source: [MDN Docs on conditionals](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/conditionals)