Skip to content

Commit 45f02e1

Browse files
authored
Merge pull request #96 from javascript-tutorial/sync-82ed8f11
Sync with upstream @ 82ed8f1
2 parents 3bb9af7 + 7e6b0bb commit 45f02e1

File tree

6 files changed

+43
-6
lines changed

6 files changed

+43
-6
lines changed

1-js/01-getting-started/2-manuals-specifications/article.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
11

22
# Manuály a specifikace
33

4+
<<<<<<< HEAD
45
Tato kniha je *tutoriál*, jehož cílem je pomoci vám postupně se naučit jazyk. Až ovšem budete znát základy, budete potřebovat i jiné zdroje.
6+
=======
7+
This book is a *tutorial*. It aims to help you gradually learn the language. But once you're familiar with the basics, you'll need other resources.
8+
>>>>>>> 82ed8f11b40bd40797427a5dd1763edbe1fca523
59
610
## Specifikace
711

812
[Specifikace ECMA-262](https://www.ecma-international.org/publications/standards/Ecma-262.htm) obsahuje nejhlubší, nejpodrobnější a nejformalizovanější informace o JavaScriptu. Ta definuje tento jazyk.
913

1014
Avšak právě kvůli této vysoké formálnosti je obtížné jí na první pohled porozumět. Potřebujete-li tedy co nejdůvěryhodnější zdroj informací o detailech JavaScriptu, tato specifikace je správné místo. Ke každodennímu použití se však nehodí.
1115

16+
<<<<<<< HEAD
1217
Každý rok se vydává nová verze specifikace. Poslední návrh nového vydání specifikace najdete na <https://tc39.es/ecma262/>.
18+
=======
19+
A new specification version is released every year. Between these releases, the latest specification draft is at <https://tc39.es/ecma262/>.
20+
>>>>>>> 82ed8f11b40bd40797427a5dd1763edbe1fca523
1321
1422
Chcete-li si přečíst o zbrusu nových vlastnostech, včetně těch, které jsou „téměř standardem“ (tzv. „3. stadium“), viz propozice na <https://github.com/tc39/proposals>.
1523

@@ -19,22 +27,35 @@ Pokud vyvíjíte pro prohlížeč, existují i další specifikace uvedené ve [
1927

2028
- **MDN (Mozilla) JavaScript Reference** je manuál s příklady a dalšími informacemi. Výborně poslouží pro získání podrobných informací o jednotlivých funkcích jazyka, metodách atd.
2129

30+
<<<<<<< HEAD
2231
Lze jej najít na <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference>.
2332

2433
Často je však nejlepší použít obyčejné internetové vyhledávání. Do dotazu jednoduše napište „MDN [pojem]“, např. pro vyhledávání funkce `parseInt` zadejte <https://google.com/search?q=MDN+parseInt>.
2534

2635
- **MSDN** – Manuál od Microsoftu s mnoha informacemi včetně těch o JavaScriptu (v IE se mu říká JScript). Potřebujete-li něco specifického ohledně Internet Exploreru, je lepší zavítat na: <http://msdn.microsoft.com/>.
36+
=======
37+
You can find it at <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference>.
38+
39+
Although, it's often best to use an internet search instead. Just use "MDN [term]" in the query, e.g. <https://google.com/search?q=MDN+parseInt> to search for the `parseInt` function.
40+
>>>>>>> 82ed8f11b40bd40797427a5dd1763edbe1fca523
2741
2842
Můžete také použít internetové vyhledávání s frázemi jako „RegExp MSDN“ nebo „RegExp MSDN jscript“.
2943

3044
## Tabulky kompatibility
3145

3246
JavaScript je neustále vyvíjen a pravidelně se do něj přidávají nové vlastnosti.
3347

48+
<<<<<<< HEAD
3449
Chcete-li vědět, v jakých enginech jsou tyto vlastnosti už podporovány, podívejte se na:
3550
- <https://caniuse.com> - pro každou vlastnost obsahuje tabulku enginů, které ji podporují, např. chcete-li vidět, které enginy podporují moderní kryptografické funkce, jděte na <http://caniuse.com/#feat=cryptography>.
3651
- <httpss://kangax.github.io/compat-table> - tabulka vlastností jazyka a enginů, které je podporují nebo nepodporují.
3752

3853
Všechny tyto zdroje se vám budou při vývoji hodit, jelikož obsahují cenné informace o detailech jazyka, jejich podpoře apod.
54+
=======
55+
- <https://caniuse.com> - per-feature tables of support, e.g. to see which engines support modern cryptography functions: <https://caniuse.com/#feat=cryptography>.
56+
- <https://kangax.github.io/compat-table> - a table with language features and engines that support those or don't support.
57+
58+
All these resources are useful in real-life development, as they contain valuable information about language details, their support, etc.
59+
>>>>>>> 82ed8f11b40bd40797427a5dd1763edbe1fca523
3960
4061
Pamatujte si je (nebo tuto stránku) pro případ, že byste potřebovali podrobné informace o určité vlastnosti.

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,26 @@ O práci s čísly si povíme víc v kapitole <info:number>.
6969

7070
## BigInt [#bigint-type]
7171

72+
<<<<<<< HEAD
7273
Typ „číslo“ v JavaScriptu nedokáže reprezentovat celočíselné hodnoty větší než <code>(2<sup>53</sup>-1)</code> (což je `9007199254740991`), nebo záporné hodnoty nižší než <code>-(-2<sup>53</sup>-1)</code>. Toto technické omezení je dáno jeho vnitřní reprezentací.
7374

7475
Pro většinu účelů to stačí, ale někdy potřebujeme opravdu velká čísla, např. pro kryptografii nebo časová razítka s přesností na mikrosekundy.
76+
=======
77+
In JavaScript, the "number" type cannot safely represent integer values larger than <code>(2<sup>53</sup>-1)</code> (that's `9007199254740991`), or less than <code>-(2<sup>53</sup>-1)</code> for negatives.
78+
79+
To be really precise, the "number" type can store larger integers (up to <code>1.7976931348623157 * 10<sup>308</sup></code>), but outside of the safe integer range <code>±(2<sup>53</sup>-1)</code> there'll be a precision error, because not all digits fit into the fixed 64-bit storage. So an "approximate" value may be stored.
80+
81+
For example, these two numbers (right above the safe range) are the same:
82+
83+
```js
84+
console.log(9007199254740991 + 1); // 9007199254740992
85+
console.log(9007199254740991 + 2); // 9007199254740992
86+
```
87+
88+
So to say, all odd integers greater than <code>(2<sup>53</sup>-1)</code> can't be stored at all in the "number" type.
89+
90+
For most purposes <code>±(2<sup>53</sup>-1)</code> range is quite enough, but sometimes we need the entire range of really big integers, e.g. for cryptography or microsecond-precision timestamps.
91+
>>>>>>> 82ed8f11b40bd40797427a5dd1763edbe1fca523
7592
7693
Proto byl do jazyka nedávno přidán typ `BigInt`, který představuje celá čísla libovolné délky.
7794

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
In modern JavaScript, there are two types of numbers:
44

5-
1. Regular numbers in JavaScript are stored in 64-bit format [IEEE-754](https://en.wikipedia.org/wiki/IEEE_754-2008_revision), also known as "double precision floating point numbers". These are numbers that we're using most of the time, and we'll talk about them in this chapter.
5+
1. Regular numbers in JavaScript are stored in 64-bit format [IEEE-754](https://en.wikipedia.org/wiki/IEEE_754), also known as "double precision floating point numbers". These are numbers that we're using most of the time, and we'll talk about them in this chapter.
66

7-
2. BigInt numbers represent integers of arbitrary length. They are sometimes needed because a regular number can't safely exceed <code>2<sup>53</sup></code> or be less than <code>-2<sup>53</sup></code>. As bigints are used in few special areas, we devote them a special chapter <info:bigint>.
7+
2. BigInt numbers represent integers of arbitrary length. They are sometimes needed because a regular integer number can't safely exceed <code>(2<sup>53</sup>-1)</code> or be less than <code>-(2<sup>53</sup>-1)</code>, as we mentioned earlier in the chapter <info:types>. As bigints are used in few special areas, we devote them a special chapter <info:bigint>.
88

99
So here we'll talk about regular numbers. Let's expand our knowledge of them.
1010

@@ -192,7 +192,7 @@ There are two ways to do so:
192192

193193
## Imprecise calculations
194194

195-
Internally, a number is represented in 64-bit format [IEEE-754](https://en.wikipedia.org/wiki/IEEE_754-2008_revision), so there are exactly 64 bits to store a number: 52 of them are used to store the digits, 11 of them store the position of the decimal point (they are zero for integer numbers), and 1 bit is for the sign.
195+
Internally, a number is represented in 64-bit format [IEEE-754](https://en.wikipedia.org/wiki/IEEE_754), so there are exactly 64 bits to store a number: 52 of them are used to store the digits, 11 of them store the position of the decimal point, and 1 bit is for the sign.
196196

197197
If a number is really huge, it may overflow the 64-bit storage and become a special numeric value `Infinity`:
198198

1-js/06-advanced-functions/05-global-object/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var gVar = 5;
2525
alert(window.gVar); // 5 (became a property of the global object)
2626
```
2727

28-
The same effect have function declarations (statements with `function` keyword in the main code flow, not function expressions).
28+
Function declarations have the same effect (statements with `function` keyword in the main code flow, not function expressions).
2929

3030
Please don't rely on that! This behavior exists for compatibility reasons. Modern scripts use [JavaScript modules](info:modules) where such a thing doesn't happen.
3131

1-js/08-prototypes/03-native-prototypes/proto-constructor-animal-rabbit.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

8-web-components/5-slots-composition/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ The shadow DOM template with proper slots:
269269
```
270270

271271
1. `<span slot="title">` goes into `<slot name="title">`.
272-
2. There are many `<li slot="item">` in the template, but only one `<slot name="item">` in the template. So all such `<li slot="item">` are appended to `<slot name="item">` one after another, thus forming the list.
272+
2. There are many `<li slot="item">` in the `<custom-menu>`, but only one `<slot name="item">` in the template. So all such `<li slot="item">` are appended to `<slot name="item">` one after another, thus forming the list.
273273

274274
The flattened DOM becomes:
275275

0 commit comments

Comments
 (0)