Skip to content

Commit e9f8c77

Browse files
authored
Merge pull request #94 from javascript-tutorial/sync-30a5d5e2
Sync with upstream @ 30a5d5e
2 parents 88fa6fb + 488def8 commit e9f8c77

File tree

43 files changed

+115
-74
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+115
-74
lines changed

1-js/02-first-steps/05-types/article.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ Někteří lidé dávají přednost `typeof(x)`, ačkoli syntaxe `typeof x` je m
263263
264264
V JavaScriptu existuje osm základních datových typů.
265265
266+
<<<<<<< HEAD
266267
- `number` pro čísla libovolného druhu: celá čísla nebo čísla s plovoucí řádovou čárkou. Celá čísla jsou omezena hodnotou <code>±(2<sup>53</sup>-1)</code>.
267268
- `bigint` pro celá čísla libovolné délky.
268269
- `string` pro řetězce. Řetězec může mít nula nebo více znaků. Neexistuje datový typ pro znak.
@@ -271,6 +272,18 @@ V JavaScriptu existuje osm základních datových typů.
271272
- `undefined` pro nepřiřazené hodnoty -- samostatný typ, který má jedinou hodnotu `undefined`.
272273
- `object` pro složitější datové struktury.
273274
- `symbol` pro unikátní identifikátory.
275+
=======
276+
- Seven primitive data types:
277+
- `number` for numbers of any kind: integer or floating-point, integers are limited by <code>±(2<sup>53</sup>-1)</code>.
278+
- `bigint` for integer numbers of arbitrary length.
279+
- `string` for strings. A string may have zero or more characters, there's no separate single-character type.
280+
- `boolean` for `true`/`false`.
281+
- `null` for unknown values -- a standalone type that has a single value `null`.
282+
- `undefined` for unassigned values -- a standalone type that has a single value `undefined`.
283+
- `symbol` for unique identifiers.
284+
- And one non-primitive data type:
285+
- `object` for more complex data structures.
286+
>>>>>>> 30a5d5e2a7c3504c9afd5028f83f4a696e60aede
274287
275288
Operátor `typeof` nám umožní zjistit, jaký typ byl uložen do proměnné.
276289

1-js/03-code-quality/01-debugging-chrome/chrome-open-sources.svg

Lines changed: 1 addition & 1 deletion
Loading

1-js/03-code-quality/01-debugging-chrome/chrome-sources-breakpoint.svg

Lines changed: 1 addition & 1 deletion
Loading

1-js/03-code-quality/01-debugging-chrome/chrome-sources-console.svg

Lines changed: 1 addition & 1 deletion
Loading

1-js/03-code-quality/01-debugging-chrome/chrome-sources-debugger-pause.svg

Lines changed: 1 addition & 1 deletion
Loading

1-js/03-code-quality/01-debugging-chrome/chrome-sources-debugger-trace-1.svg

Lines changed: 1 addition & 1 deletion
Loading

1-js/03-code-quality/01-debugging-chrome/chrome-tabs.svg

Lines changed: 1 addition & 1 deletion
Loading

1-js/03-code-quality/02-coding-style/code-style.svg

Lines changed: 1 addition & 1 deletion
Loading

1-js/05-data-types/02-number/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ A few examples:
403403
```
404404

405405
`Math.max(a, b, c...)` and `Math.min(a, b, c...)`
406-
: Returns the greatest/smallest from the arbitrary number of arguments.
406+
: Returns the greatest and smallest from the arbitrary number of arguments.
407407

408408
```js run
409409
alert( Math.max(3, 5, -10, 0, 1) ); // 5

1-js/05-data-types/05-array-methods/article.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ So `typeof` does not help to distinguish a plain object from an array:
676676

677677
```js run
678678
alert(typeof {}); // object
679-
alert(typeof []); // same
679+
alert(typeof []); // object (same)
680680
```
681681

682682
...But arrays are used so often that there's a special method for that: [Array.isArray(value)](mdn:js/Array/isArray). It returns `true` if the `value` is an array, and `false` otherwise.
@@ -767,7 +767,7 @@ A cheat sheet of array methods:
767767
- `reduce/reduceRight(func, initial)` -- calculate a single value over the array by calling `func` for each element and passing an intermediate result between the calls.
768768

769769
- Additionally:
770-
- `Array.isArray(arr)` checks `arr` for being an array.
770+
- `Array.isArray(value)` checks `value` for being an array, if so returns `true`, otherwise `false`.
771771

772772
Please note that methods `sort`, `reverse` and `splice` modify the array itself.
773773

@@ -780,7 +780,7 @@ These methods are the most used ones, they cover 99% of use cases. But there are
780780
These methods behave sort of like `||` and `&&` operators: if `fn` returns a truthy value, `arr.some()` immediately returns `true` and stops iterating over the rest of items; if `fn` returns a falsy value, `arr.every()` immediately returns `false` and stops iterating over the rest of items as well.
781781

782782
We can use `every` to compare arrays:
783-
783+
784784
```js run
785785
function arraysEqual(arr1, arr2) {
786786
return arr1.length === arr2.length && arr1.every((value, index) => value === arr2[index]);

0 commit comments

Comments
 (0)