Merge pull request #372 from brentguf/javascript-specials

JavaScript Specials: Typos and clarification
This commit is contained in:
Ilya Kantor 2018-03-03 09:22:08 +03:00 committed by GitHub
commit 3c832f5b7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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: