Skip to content

Commit 479d9d8

Browse files
authored
Merge branch 'master' into Destructuring_assignment
2 parents e73afb8 + 06a13d7 commit 479d9d8

File tree

67 files changed

+2286
-481
lines changed

Some content is hidden

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

67 files changed

+2286
-481
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: iliakan

1-js/02-first-steps/04-variables/article.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,26 @@ In older scripts, you may also find another keyword: `var` instead of `let`:
103103
*!*var*/!* message = 'Hello';
104104
```
105105

106+
<<<<<<< HEAD
106107
Das `var` Schlüsselwort ist *fast* dasselbe wie `let`. Es deklariert auch eine Variable, aber auf eine etwas andere, "altbackene" Weise.
107108

108109
Es gibt subtile Unterschiede zwischen `let` und `var`, aber sie sind für uns noch nicht wichtig. Wir werden sie im Kapitel <info:var> ausführlich behandeln.
110+
=======
111+
The `var` keyword is *almost* the same as `let`. It also declares a variable but in a slightly different, "old-school" way.
112+
113+
There are subtle differences between `let` and `var`, but they do not matter to us yet. We'll cover them in detail in the chapter <info:var>.
114+
>>>>>>> b258d7d5b635c88228f7556e14fbe5e5ca7f736d
109115
````
110116
111117
## Eine Analogie aus dem wirklichen Leben
112118
113119
Wir können das Konzept einer "Variablen" leicht verstehen, wenn wir sie uns als eine "Kiste" für Daten vorstellen, mit einem eindeutig benannten Aufkleber darauf.
114120
121+
<<<<<<< HEAD
115122
Zum Beispiel kann man sich die Variable `message` als eine Kiste vorstellen mit der Bezeichnung `"message"` und dem Wert `"Hello!"` darin:
123+
=======
124+
For instance, the variable `message` can be imagined as a box labelled `"message"` with the value `"Hello!"` in it:
125+
>>>>>>> b258d7d5b635c88228f7556e14fbe5e5ca7f736d
116126
117127
![](variable.svg)
118128
@@ -238,19 +248,27 @@ Variables named `apple` and `APPLE` are two different variables.
238248
```
239249
240250
````smart header="Non-Latin letters are allowed, but not recommended"
251+
<<<<<<< HEAD
241252
It is possible to use any language, including cyrillic letters, Chinese logograms and so on, like this:
242253
>>>>>>> d694e895efe89922a109702085b6ca1efeffea10
254+
=======
255+
It is possible to use any language, including Cyrillic letters, Chinese logograms and so on, like this:
256+
>>>>>>> b258d7d5b635c88228f7556e14fbe5e5ca7f736d
243257
244258
```js
245259
let имя = '...';
246260
let 我 = '...';
247261
```
248262
263+
<<<<<<< HEAD
249264
<<<<<<< HEAD
250265
Technisch gesehen gibt es hier keinen Fehler, solche Namen sind erlaubt, aber es gibt eine internationale Tradition, Englisch in Variablennamen zu verwenden. Selbst wenn wir ein kleines Script schreiben, kann es ein langes Leben vor sich haben. Menschen aus anderen Ländern müssen es vielleicht irgendwann einmal lesen.
251266
=======
252267
Technically, there is no error here. Such names are allowed, but there is an international convention to use English in variable names. Even if we're writing a small script, it may have a long life ahead. People from other countries may need to read it some time.
253268
>>>>>>> d35baee32dcce127a69325c274799bb81db1afd8
269+
=======
270+
Technically, there is no error here. Such names are allowed, but there is an international convention to use English in variable names. Even if we're writing a small script, it may have a long life ahead. People from other countries may need to read it sometime.
271+
>>>>>>> b258d7d5b635c88228f7556e14fbe5e5ca7f736d
254272
````
255273

256274
````warn header="Reservierte Namen"
@@ -305,16 +323,24 @@ const myBirthday = '18.04.1982';
305323
myBirthday = '01.01.2001'; // Fehler, Konstante kann nicht neu zugewiesen werden!
306324
```
307325
326+
<<<<<<< HEAD
308327
Wenn ein Programmierer sicher ist, dass eine Variable sich nie ändern wird, kann er sie mit `const` deklarieren, um diese Tatsache zu garantieren und jedem klar zu kommunizieren.
309328
310329
<<<<<<< HEAD
330+
=======
331+
When a programmer is sure that a variable will never change, they can declare it with `const` to guarantee and communicate that fact to everyone.
332+
>>>>>>> b258d7d5b635c88228f7556e14fbe5e5ca7f736d
311333
312334
### Konstanten in Großbuchstaben
313335
=======
314336
### Uppercase constants
315337
>>>>>>> d694e895efe89922a109702085b6ca1efeffea10
316338
339+
<<<<<<< HEAD
317340
Es ist eine weit verbreitete Vorgehensweise, Konstanten als Alias für schwer zu merkende Werte zu verwenden, die bereits vor der Ausführung bekannt sind.
341+
=======
342+
There is a widespread practice to use constants as aliases for difficult-to-remember values that are known before execution.
343+
>>>>>>> b258d7d5b635c88228f7556e14fbe5e5ca7f736d
318344
319345
Solche Konstanten werden mit Großbuchstaben und Unterstrichen benannt.
320346
@@ -339,7 +365,11 @@ Vorteile:
339365
340366
Wann sollten wir Großbuchstaben für eine Konstante verwenden und wann sollten wir sie normal benennen? Lass uns das klarstellen.
341367
368+
<<<<<<< HEAD
342369
Eine "Konstante" zu sein bedeutet nur, dass sich der Wert einer Variablen nie ändert. Aber es gibt Konstanten, die vor der Ausführung bekannt sind (wie ein hexadezimaler Wert für die Farbe rot) und es gibt Konstanten, die zur Laufzeit, also während der Ausführung, *berechnet* werden, sich aber nach ihrer anfänglichen Zuweisung nicht mehr ändern.
370+
=======
371+
Being a "constant" just means that a variable's value never changes. But some constants are known before execution (like a hexadecimal value for red) and some constants are *calculated* in run-time, during the execution, but do not change after their initial assignment.
372+
>>>>>>> b258d7d5b635c88228f7556e14fbe5e5ca7f736d
343373
344374
<<<<<<< HEAD
345375
Zum Beispiel:
@@ -351,7 +381,11 @@ For instance:
351381
const pageLoadTime = /* Zeit, die eine Website braucht, um geladen zu werden */;
352382
```
353383
384+
<<<<<<< HEAD
354385
Der Wert von `pageLoadTime` ist vor dem Laden der Seite nicht bekannt, daher wird er normal benannt. Aber es ist immer noch eine Konstante, weil er sich nach der Zuweisung nicht mehr ändert.
386+
=======
387+
The value of `pageLoadTime` is not known before the page load, so it's named normally. But it's still a constant because it doesn't change after the assignment.
388+
>>>>>>> b258d7d5b635c88228f7556e14fbe5e5ca7f736d
355389
356390
<<<<<<< HEAD
357391
Mit anderen Worten, großgeschriebene Konstanten werden nur als Aliase für "hart kodierte" Werte verwendet.
@@ -365,18 +399,31 @@ Apropos Variablen, es gibt noch eine extrem wichtige Sache.
365399
366400
Ein Variablenname sollte eine saubere, offensichtliche Bedeutung haben, die die Daten beschreibt, die er speichert.
367401
402+
<<<<<<< HEAD
368403
Die Benennung von Variablen ist eine der wichtigsten und komplexesten Fähigkeiten in der Programmierung. Ein schneller Blick auf Variablennamen kann zeigen, welcher Code von einem Anfänger im Gegensatz zu einem erfahrenen Entwickler geschrieben wurde.
369404
370405
In einem echten Projekt wird die meiste Zeit damit verbracht, eine bestehende Codebasis zu modifizieren und zu erweitern, anstatt etwas völlig Neues zu schreiben. Wenn wir zu irgendeinem Code zurückkehren, nachdem wir eine Weile etwas anderes gemacht haben, ist es viel einfacher Informationen zu finden, die gut beschriftet sind. Oder, mit anderen Worten, wenn die Variablen gute Namen haben.
406+
=======
407+
Variable naming is one of the most important and complex skills in programming. A glance at variable names can reveal which code was written by a beginner versus an experienced developer.
408+
409+
In a real project, most of the time is spent modifying and extending an existing code base rather than writing something completely separate from scratch. When we return to some code after doing something else for a while, it's much easier to find information that is well-labelled. Or, in other words, when the variables have good names.
410+
>>>>>>> b258d7d5b635c88228f7556e14fbe5e5ca7f736d
371411
372412
Bitte denk über den richtigen Namen für eine Variable nach, bevor du sie deklarierst. Das wird sich ordentlich auszahlen.
373413
374414
Einige Regeln, die gut zu befolgen sind:
375415
416+
<<<<<<< HEAD
376417
- Verwende menschenlesbare Namen, wie `userName` oder `shoppingCart`.
377418
- Halte dich fern von Abkürzungen oder Kürzel wie `a`, `b`, `c`, es sei denn, du weißt wirklich, was du tust.
378419
- Mach Namen maximal beschreibend und prägnant. Beispiele für schlechte Namen sind `data` und `value`. Solche Namen sagen nichts aus. Es ist nur in Ordnung, sie zu benutzen, wenn der Kontext des Codes es außergewöhnlich offensichtlich macht, auf welche Daten oder Werte die Variable verweist.
379420
- Mach dir mit dir selbst und deinem Team Bedingungen aus. Wenn ein Website Besucher "user" genannt wird, dann sollten verwandte Variablen `currentUser` oder `newUser` heißen, anstatt `currentVisitor` oder `newManInTown`.
421+
=======
422+
- Use human-readable names like `userName` or `shoppingCart`.
423+
- Stay away from abbreviations or short names like `a`, `b`, and `c`, unless you know what you're doing.
424+
- Make names maximally descriptive and concise. Examples of bad names are `data` and `value`. Such names say nothing. It's only okay to use them if the context of the code makes it exceptionally obvious which data or value the variable is referencing.
425+
- Agree on terms within your team and in your mind. If a site visitor is called a "user" then we should name related variables `currentUser` or `newUser` instead of `currentVisitor` or `newManInTown`.
426+
>>>>>>> b258d7d5b635c88228f7556e14fbe5e5ca7f736d
380427
381428
Klingt einfach? Ist es auch, aber die Erstellung von beschreibenden und prägnanten Variablennamen ist es in der Praxis nicht. Nur zu.
382429

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ const bigInt = 1234567890123456789012345678901234567890n;
114114
115115
Da `BigInt`-Zahlen selten benötigt werden, behandeln wir sie hier nicht, sondern widmen ihnen ein eigenes Kapitel <info:bigint>. Lies es, wenn du so große Zahlen brauchst.
116116
117+
<<<<<<< HEAD
117118
<<<<<<< HEAD
118119
```smart header="Compatability issues"
119120
Im Moment wird `BigInt` in Firefox/Chrome/Edge unterstützt, aber nicht in Safari/IE.
@@ -126,6 +127,8 @@ Right now, `BigInt` is supported in Firefox/Chrome/Edge/Safari, but not in IE.
126127
127128
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.
128129
130+
=======
131+
>>>>>>> b258d7d5b635c88228f7556e14fbe5e5ca7f736d
129132
## String
130133
131134
Ein String in JavaScript muss in Anführungszeichen gesetzt werden.

1-js/03-code-quality/06-polyfills/article.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ Es ist also durchaus üblich, dass eine Engine nur einen Teil des Standards impl
1515
So it's quite common for an engine to implement only part of the standard.
1616
>>>>>>> d694e895efe89922a109702085b6ca1efeffea10
1717
18+
<<<<<<< HEAD
1819
Eine gute Seite, um den aktuellen Stand der Unterstützung für Sprachfunktionen zu sehen, ist <https://kangax.github.io/compat-table/es6/> (es ist groß, wir haben noch viel zu lernen).
20+
=======
21+
A good page to see the current state of support for language features is <https://compat-table.github.io/compat-table/es6/> (it's big, we have a lot to study yet).
22+
>>>>>>> b258d7d5b635c88228f7556e14fbe5e5ca7f736d
1923
2024
As programmers, we'd like to use most recent features. The more good stuff - the better!
2125

@@ -129,7 +133,6 @@ JavaScript is a highly dynamic language. Scripts may add/modify any function, ev
129133
130134
Two interesting polyfill libraries are:
131135
- [core js](https://github.com/zloirock/core-js) that supports a lot, allows to include only needed features.
132-
- [polyfill.io](https://polyfill.io/) service that provides a script with polyfills, depending on the features and user's browser.
133136
134137
135138
## Summary
@@ -141,7 +144,7 @@ Just don't forget to use a transpiler (if using modern syntax or operators) and
141144
For example, later when you're familiar with JavaScript, you can setup a code build system based on [webpack](https://webpack.js.org/) with the [babel-loader](https://github.com/babel/babel-loader) plugin.
142145
143146
Good resources that show the current state of support for various features:
144-
- <https://kangax.github.io/compat-table/es6/> - for pure JavaScript.
147+
- <https://compat-table.github.io/compat-table/es6/> - for pure JavaScript.
145148
- <https://caniuse.com/> - for browser-related functions.
146149
147150
P.S. Google Chrome is usually the most up-to-date with language features, try it if a tutorial demo fails. Most tutorial demos work with any modern browser though.

1-js/04-object-basics/04-object-methods/8-chain-calls/task.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ importance: 2
44

55
# Chaining
66

7-
There's a `ladder` object that allows to go up and down:
7+
There's a `ladder` object that allows you to go up and down:
88

99
```js
1010
let ladder = {
@@ -21,7 +21,7 @@ let ladder = {
2121
};
2222
```
2323

24-
Now, if we need to make several calls in sequence, can do it like this:
24+
Now, if we need to make several calls in sequence, we can do it like this:
2525

2626
```js
2727
ladder.up();
@@ -32,10 +32,10 @@ ladder.down();
3232
ladder.showStep(); // 0
3333
```
3434

35-
Modify the code of `up`, `down` and `showStep` to make the calls chainable, like this:
35+
Modify the code of `up`, `down`, and `showStep` to make the calls chainable, like this:
3636

3737
```js
3838
ladder.up().up().down().showStep().down().showStep(); // shows 1 then 0
3939
```
4040

41-
Such approach is widely used across JavaScript libraries.
41+
Such an approach is widely used across JavaScript libraries.

1-js/04-object-basics/09-object-toprimitive/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ let obj = {
253253
}
254254
};
255255

256-
alert(obj + 2); // 22 ("2" + 2), conversion to primitive returned a string => concatenation
256+
alert(obj + 2); // "22" ("2" + 2), conversion to primitive returned a string => concatenation
257257
```
258258

259259
## Summary

0 commit comments

Comments
 (0)