You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: javascript/javascript.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,7 @@ Alerts work similarly in that you put what you want to display in the alert with
56
56
57
57
Prompts are alerts that ask for something from the user. You can store this information in a variable, which we'll talk about later in the lecture. Otherwise, it will return a string with what the user inputs.
58
58
59
-

59
+

60
60
61
61
### Comments
62
62
@@ -128,7 +128,7 @@ Note: PEMDAS (order of operations) applies in JS math, as well as all other prog
128
128
You can do math the traditional way (e.g., `x + y`), but there are also some handy operators you can use. The increment (`++`) and decrement (`--`) operators, otherwise known as examples of unary operators (operation with only one operand), are helpful for quick addition or subtraction by 1. There are also addition, subtraction, multiplication, division, and modulus assignment operators, which do the selected operation but also assign the value after the operation to its variable.
129
129
130
130
### Strings
131
-
When you're manipulating strings, you'll often have to join two strings together. This process is called **concatenation**. There are two good ways that you can concatenate in JS: the plus operator and template strings. There are a few other ways that you can concatenate, but for beginners, we won't recommend them here. Using the plus operator, you're just directly combining two strings in probably the most intuitive way. With template strings, you use backticks (\`) instead of quotes, and in the place of your variable, you surround it with brackets (`{}`) and put a dollar sign in front of it. It's easier to see the surroundings of your variable in template strings, helping code readability.
131
+
When you're manipulating strings, you'll often have to join two strings together. This process is called **concatenation**. There are two good ways that you can concatenate in JS: the plus operator and template strings. There are a few other ways that you can concatenate, but for beginners, we won't recommend them here. Using the plus operator, you're just directly combining two strings in probably the most intuitive way. With template strings, you use backticks (\`) instead of quotes, and in the place of your variable, you surround it with brackets (`{}`) and put a dollar sign (`$`) in front of it. It's easier to see the surroundings of your variable in template strings, helping code readability.
132
132
133
133
There's a lot more on strings, but we won't get into it for the sake of this introduction.
134
134
@@ -173,7 +173,7 @@ Alternatively, you can also string together different operations such as not, an
173
173
- both conditions being evaluated must be `true` in order for `&&` to return `true`
174
174
- only one condition being evaluated has to return `true` in order for `||` to return `true`
175
175
176
-

176
+

177
177
178
178
## Loops
179
179
What if you have to repeat a task a lot? Let's find more efficient ways to write code.
0 commit comments