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: 1-js/01-getting-started/1-intro/article.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ Different engines have different "codenames". For example:
26
26
27
27
-[V8](https://en.wikipedia.org/wiki/V8_(JavaScript_engine)) -- in Chrome and Opera.
28
28
-[SpiderMonkey](https://en.wikipedia.org/wiki/SpiderMonkey) -- in Firefox.
29
-
- ...There are other codenames like "Trident" and "Chakra" for different versions of IE, "ChakraCore" for Microsoft Edge, "Nitro" and "SquirrelFish" for Safari, etc.
29
+
- ...There are other codenames like "Chakra" for IE, "ChakraCore" for Microsoft Edge, "Nitro" and "SquirrelFish" for Safari, etc.
30
30
31
31
The terms above are good to remember because they are used in developer articles on the internet. We'll use them too. For instance, if "a feature X is supported by V8", then it probably works in Chrome and Opera.
As `BigInt` numbers are rarely needed, we don't cover them here, but devoted them a separate chapter <info:bigint>. Read it when you need such big numbers.
83
83
84
+
84
85
```smart header="Compatibility issues"
85
-
Right now `BigInt` is supported in Firefox/Chrome/Edge, but not in Safari/IE.
86
+
Right now, `BigInt` is supported in Firefox/Chrome/Edge/Safari, but not in IE.
86
87
```
87
88
89
+
You can check [*MDN* BigInt compatibility table](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt#Browser_compatibility) to know which versions of a browser are supported.
90
+
88
91
## String
89
92
90
93
A string in JavaScript must be surrounded by quotes.
Copy file name to clipboardExpand all lines: 1-js/02-first-steps/08-operators/article.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -180,7 +180,7 @@ Parentheses override any precedence, so if we're not satisfied with the default
180
180
181
181
There are many operators in JavaScript. Every operator has a corresponding precedence number. The one with the larger number executes first. If the precedence is the same, the execution order is from left to right.
182
182
183
-
Here's an extract from the [precedence table](https://developer.mozilla.org/en/JavaScript/Reference/operators/operator_precedence) (you don't need to remember this, but note that unary operators are higher than corresponding binary ones):
183
+
Here's an extract from the [precedence table](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence) (you don't need to remember this, but note that unary operators are higher than corresponding binary ones):
Copy file name to clipboardExpand all lines: 1-js/02-first-steps/09-comparison/article.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,9 @@ In JavaScript they are written like this:
9
9
- Equals: `a == b`, please note the double equality sign `==` means the equality test, while a single one `a = b` means an assignment.
10
10
- Not equals. In maths the notation is <code>≠</code>, but in JavaScript it's written as <code>a != b</code>.
11
11
12
-
In this article we'll learn more about different types of comparisons, how JavaScript makes them, including important peculiarities.
12
+
In this article we'll learn more about different types of comparisons, how JavaScript makes them, including important peculiarities.
13
13
14
-
At the end you'll find a good recipe to avoid "javascript quirks"-related issues.
14
+
At the end you'll find a good recipe to avoid "JavaScript quirks"-related issues.
15
15
16
16
## Boolean is the result
17
17
@@ -57,7 +57,7 @@ The algorithm to compare two strings is simple:
57
57
4. Repeat until the end of either string.
58
58
5. If both strings end at the same length, then they are equal. Otherwise, the longer string is greater.
59
59
60
-
In the examples above, the comparison `'Z' > 'A'` gets to a result at the first step while the strings `"Glow"` and `"Glee"` are compared character-by-character:
60
+
In the examples above, the comparison `'Z' > 'A'` gets to a result at the first step while the strings `'Glow'` and `'Glee'` are compared character-by-character:
Copy file name to clipboardExpand all lines: 1-js/02-first-steps/11-logical-operators/article.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,7 +84,7 @@ The OR `||` operator does the following:
84
84
85
85
A value is returned in its original form, without the conversion.
86
86
87
-
In other words, a chain of OR `"||"` returns the first truthy value or the last one if no truthy value is found.
87
+
In other words, a chain of OR `||` returns the first truthy value or the last one if no truthy value is found.
88
88
89
89
For instance:
90
90
@@ -101,9 +101,9 @@ This leads to some interesting usage compared to a "pure, classical, boolean-onl
101
101
102
102
1.**Getting the first truthy value from a list of variables or expressions.**
103
103
104
-
For instance, we have `firstName`, `lastName` and `nickName` variables, all optional.
104
+
For instance, we have `firstName`, `lastName` and `nickName` variables, all optional (i.e. can be undefined or have falsy values).
105
105
106
-
Let's use OR `||` to choose the one that has the data and show it (or `anonymous` if nothing set):
106
+
Let's use OR `||` to choose the one that has the data and show it (or `"Anonymous"` if nothing set):
107
107
108
108
```js run
109
109
let firstName ="";
@@ -115,7 +115,7 @@ This leads to some interesting usage compared to a "pure, classical, boolean-onl
115
115
*/!*
116
116
```
117
117
118
-
If all variables were falsy, `Anonymous` would show up.
118
+
If all variables were falsy, `"Anonymous"` would show up.
119
119
120
120
2.**Short-circuit evaluation.**
121
121
@@ -223,7 +223,7 @@ The precedence of AND `&&` operator is higher than OR `||`.
223
223
So the code `a && b || c && d` is essentially the same as if the `&&` expressions were in parentheses: `(a && b) || (c && d)`.
224
224
````
225
225
226
-
````warn header="Don't replace `if`with|| or &&"
226
+
````warn header="Don't replace `if`with`||` or `&&`"
227
227
Sometimes, people use the AND `&&` operator as a "shorter way to write `if`".
228
228
229
229
For instance:
@@ -244,7 +244,7 @@ let x = 1;
244
244
if (x > 0) alert( 'Greater than zero!' );
245
245
```
246
246
247
-
Although, the variant with `&&` appears shorter, `if` is more obvious and tends to be a little bit more readable. So we recommend using every construct for its purpose: use `if` if we want if and use `&&` if we want AND.
247
+
Although, the variant with `&&` appears shorter, `if` is more obvious and tends to be a little bit more readable. So we recommend using every construct for its purpose: use `if` if we want `if` and use `&&` if we want AND.
0 commit comments