Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f707218

Browse files
authoredJan 20, 2020
Merge pull request #9 from JoeGab/master
Variables
2 parents a231101 + 912673f commit f707218

File tree

7 files changed

+141
-140
lines changed

7 files changed

+141
-140
lines changed
 

‎1-js/02-first-steps/04-variables/1-hello-variables/solution.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
In the code below, each line corresponds to the item in the task list.
1+
Im nachfolgenden Code entspricht jede Zeile der Position in der Aufgabenliste.
22

33
```js run
4-
let admin, name; // can declare two variables at once
4+
let admin, name; // kann zwei Variablen auf einmal deklarieren
55

66
name = "John";
77

‎1-js/02-first-steps/04-variables/1-hello-variables/task.md

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

33
---
44

5-
# Working with variables
5+
# Arbeiten mit Variablen
66

7-
1. Declare two variables: `admin` and `name`.
8-
2. Assign the value `"John"` to `name`.
9-
3. Copy the value from `name` to `admin`.
10-
4. Show the value of `admin` using `alert` (must output "John").
7+
1. Deklariere zwei Variablen: `admin` und `name`.
8+
2. Weise den Wert `"John"` der Variable `name` zu.
9+
3. Kopiere den Wert von `name` nach `admin`.
10+
4. Zeige den Wert von `admin` mittels `alert` an (muss "John" ausgeben).

‎1-js/02-first-steps/04-variables/2-declare-variables/solution.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
1-
## The variable for our planet
1+
## Die Variable für unseren Planeten
22

3-
That's simple:
3+
Das ist einfach:
44

55
```js
66
let ourPlanetName = "Earth";
77
```
88

9-
Note, we could use a shorter name `planet`, but it might be not obvious what planet it refers to. It's nice to be more verbose. At least until the variable isNotTooLong.
9+
Beachte, wir könnten einen kürzeren Namen `planet` verwenden, aber es könnte nicht offensichtlich sein, auf welchen Planeten er sich bezieht. Es ist schön, etwas ausführlicher zu sein. Zumindest bis die Variable nicht zu lang ist.
1010

11-
## The name of the current visitor
11+
## Der Name des aktuellen Besuchers
1212

1313
```js
1414
let currentUserName = "John";
1515
```
1616

17-
Again, we could shorten that to `userName` if we know for sure that the user is current.
17+
Auch hier könnten wir das auf `userName` kürzen, wenn wir sicher wissen, dass der Benutzer aktuell ist.
1818

19-
Modern editors and autocomplete make long variable names easy to write. Don't save on them. A name with 3 words in it is fine.
19+
Moderne Editoren und Autovervollständigung machen lange Variablennamen einfach zu schreiben. Spare nicht daran. Ein Name mit 3 Wörtern darin ist in Ordnung.
20+
21+
Und wenn dein Editor nicht über die anständige Autovervollständigung verfügt, hol dir [einen neuen](/code-editors).
2022

21-
And if your editor does not have proper autocompletion, get [a new one](/code-editors).

‎1-js/02-first-steps/04-variables/2-declare-variables/task.md

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

33
---
44

5-
# Giving the right name
5+
# Dinge richtig benennen
66

7-
1. Create a variable with the name of our planet. How would you name such a variable?
8-
2. Create a variable to store the name of a current visitor to a website. How would you name that variable?
7+
1. Erstelle eine Variable mit dem Namen unseres Planeten. Wie würdest du so eine Variable benennen?
8+
2. Erstelle eine Variable, um den Namen eines aktuellen Besuchers einer Website zu speichern. Wie würdest du diese Variable benennen?
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
We generally use upper case for constants that are "hard-coded". Or, in other words, when the value is known prior to execution and directly written into the code.
1+
Für Konstanten, die "hart-codiert" sind, verwenden wir in der Regel Großbuchstaben. Oder, mit anderen Worten, wenn der Wert vor der Ausführung bekannt ist und direkt in den Code geschrieben wird.
22

3-
In this code, `birthday` is exactly like that. So we could use the upper case for it.
3+
In diesem Code ist der Geburtstag `birthday` genau so. Wir können also Großbuchstaben dafür verwenden.
44

5-
In contrast, `age` is evaluated in run-time. Today we have one age, a year after we'll have another one. It is constant in a sense that it does not change through the code execution. But it is a bit "less of a constant" than `birthday`: it is calculated, so we should keep the lower case for it.
5+
Im Gegensatz dazu wird das Alter `age` zur Laufzeit ausgewertet. Heute haben wir ein Alter, ein Jahr später ein anderes. Es ist in gewissem Sinne konstant, dass es sich durch die Codeausführung nicht ändert. Aber es ist ein bisschen "weniger konstant" als der Geburtstag `birthday`: es wird berechnet, also sollten wir die Kleinschreibung dafür beibehalten.

‎1-js/02-first-steps/04-variables/3-uppercast-constant/task.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@ importance: 4
22

33
---
44

5-
# Uppercase const?
5+
# const in Großbuchstaben?
66

7-
Examine the following code:
7+
Betrachte den folgenden Code:
88

99
```js
1010
const birthday = '18.04.1982';
1111

1212
const age = someCode(birthday);
1313
```
1414

15-
Here we have a constant `birthday` date and the `age` is calculated from `birthday` with the help of some code (it is not provided for shortness, and because details don't matter here).
15+
Hier haben wir ein konstantes Geburtsdatum `birthday` und das Alter `age`, welches berechnet wird aus `birthday` mittels eines gewissen Codes (dieser wird der Kürze wegen nicht angegeben und weil Details hier keine Rolle spielen).
1616

17-
Would it be right to use upper case for `birthday`? For `age`? Or even for both?
17+
Wäre es richtig, für `birthday` Großbuchstaben zu verwenden? Für `age`? der sogar für beide
1818

1919
```js
20-
const BIRTHDAY = '18.04.1982'; // make uppercase?
20+
const BIRTHDAY = '18.04.1982'; // in Großbuchstaben?
2121

22-
const AGE = someCode(BIRTHDAY); // make uppercase?
22+
const AGE = someCode(BIRTHDAY); // in Großbuchstaben?
2323
```
2424

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

Lines changed: 114 additions & 114 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.