Merge pull request #372 from brentguf/javascript-specials
JavaScript Specials: Typos and clarification
This commit is contained in:
commit
3c832f5b7c
1 changed files with 3 additions and 3 deletions
|
@ -132,7 +132,7 @@ JavaScript supports the following operators:
|
||||||
Arithmetical
|
Arithmetical
|
||||||
: Regular: `* + - /`, also `%` for the remainder and `**` for power of a number.
|
: Regular: `* + - /`, also `%` for the remainder and `**` for power of a number.
|
||||||
|
|
||||||
Binary plus `+` concatenates strings. And if any of the operands is a string, the other one is converted to string too:
|
The binary plus `+` concatenates strings. And if any of the operands is a string, the other one is converted to string too:
|
||||||
|
|
||||||
```js run
|
```js run
|
||||||
alert( '1' + 2 ); // '12', string
|
alert( '1' + 2 ); // '12', string
|
||||||
|
@ -202,7 +202,7 @@ Later we'll study more types of loops to deal with objects.
|
||||||
|
|
||||||
## The "switch" construct
|
## The "switch" construct
|
||||||
|
|
||||||
The "switch" construct can replace multiple `if` checks. It uses `===` for comparisons.
|
The "switch" construct can replace multiple `if` checks. It uses `===` (strict equality) for comparisons.
|
||||||
|
|
||||||
For instance:
|
For instance:
|
||||||
|
|
||||||
|
@ -248,7 +248,7 @@ We covered three ways to create a function in JavaScript:
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Function expression can have a name, like `sum = function name(a, b)`, but that `name` is only visible inside that function.
|
Function expressions can have a name, like `sum = function name(a, b)`, but that `name` is only visible inside that function.
|
||||||
|
|
||||||
3. Arrow functions:
|
3. Arrow functions:
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue