From f3e240f92f64ba897cf7e1579fd2948004c347f1 Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 17 Mar 2020 13:24:23 +0100 Subject: [PATCH 01/41] Update task.md --- .../11-logical-operators/1-alert-null-2-undefined/task.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1-js/02-first-steps/11-logical-operators/1-alert-null-2-undefined/task.md b/1-js/02-first-steps/11-logical-operators/1-alert-null-2-undefined/task.md index a7c9addfc..1e2a9e6d3 100644 --- a/1-js/02-first-steps/11-logical-operators/1-alert-null-2-undefined/task.md +++ b/1-js/02-first-steps/11-logical-operators/1-alert-null-2-undefined/task.md @@ -2,9 +2,9 @@ importance: 5 --- -# What's the result of OR? +# Welches Ergebnis liefert ODER ? -What is the code below going to output? +Was gibt der untenstehende Code aus ? ```js alert( null || 2 || undefined ); From be76b2df65c41c4af1526c39ed12ec72746427f0 Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 17 Mar 2020 14:48:06 +0100 Subject: [PATCH 02/41] Update article.md --- .../11-logical-operators/article.md | 202 +++++++++--------- 1 file changed, 101 insertions(+), 101 deletions(-) diff --git a/1-js/02-first-steps/11-logical-operators/article.md b/1-js/02-first-steps/11-logical-operators/article.md index 25f8ff7f5..7463f628a 100644 --- a/1-js/02-first-steps/11-logical-operators/article.md +++ b/1-js/02-first-steps/11-logical-operators/article.md @@ -1,24 +1,24 @@ -# Logical operators +# Logische Operatoren -There are three logical operators in JavaScript: `||` (OR), `&&` (AND), `!` (NOT). +Es gibt drei logische Operatoren in JavaScript: `||` (ODER), `&&` (UND), `!` (NICHT). -Although they are called "logical", they can be applied to values of any type, not only boolean. Their result can also be of any type. +Obgleich sie "logisch" genannt werden, lassen sie sich auf Werte eines beliebigen Typs anwenden, nicht nur 'boolean'. Genauso kann ihr Ergebnis jedweden Typ haben. -Let's see the details. +Werfen wir einen Blick auf die Details. -## || (OR) +## || (ODER) -The "OR" operator is represented with two vertical line symbols: +Der Operator "ODER" wird mit zwei senkrechten Strichen repräsentiert: ```js result = a || b; ``` -In classical programming, the logical OR is meant to manipulate boolean values only. If any of its arguments are `true`, it returns `true`, otherwise it returns `false`. +In der klasssischen Programmierung dient das logische ODER nur zur Verarbeitung Boolescher Werte. Falls eines seiner Argumente `true` ist, liefert es `true`, andernfalls `false`. -In JavaScript, the operator is a little bit trickier and more powerful. But first, let's see what happens with boolean values. +In JavaScript ist der Operator etwas subtiler und mächtiger. Aber schauen wir uns zuerst an, was mit Booleschen Werten passiert. -There are four possible logical combinations: +Es gibt vier mögliche logische Kombinationen: ```js run alert( true || true ); // true @@ -27,21 +27,21 @@ alert( true || false ); // true alert( false || false ); // false ``` -As we can see, the result is always `true` except for the case when both operands are `false`. +Wir stellen fest, das Ergbenis ist immer `true` mit Ausnahme des Falls, daß beide Operanden `false` sind. -If an operand is not a boolean, it's converted to a boolean for the evaluation. +Falls ein Operand kein Boolescher Wert ist, wird er für die Auswertung in den Typ `boolean` konvertiert. -For instance, the number `1` is treated as `true`, the number `0` as `false`: +Beispielsweise wird die Zahl `1` als `true` interpretiert, die Zahl `0` als `false`: ```js run -if (1 || 0) { // works just like if( true || false ) - alert( 'truthy!' ); +if (1 || 0) { // Gleichwertig zu if( true || false ) + alert( 'Effektiv wahr!' ); } ``` -Most of the time, OR `||` is used in an `if` statement to test if *any* of the given conditions is `true`. +Meistens wird ODER `||` in einem `if`-Statement genutzt um zu prüfen, ob *irgendeine* der vorgegebenen Bedingungen `true` ist. -For example: +Beispiel: ```js run let hour = 9; @@ -49,91 +49,91 @@ let hour = 9; *!* if (hour < 10 || hour > 18) { */!* - alert( 'The office is closed.' ); + alert( 'Das Büro ist geschlossen.' ); } ``` -We can pass more conditions: +Wir können weitere Bedingungen ergänzen: ```js run let hour = 12; let isWeekend = true; if (hour < 10 || hour > 18 || isWeekend) { - alert( 'The office is closed.' ); // it is the weekend + alert( 'Das Büro ist geschlossen.' ); // Es ist Wochenende } ``` -## OR "||" finds the first truthy value +## ODER "||" findet den ersten effektiv wahren Wert -The logic described above is somewhat classical. Now, let's bring in the "extra" features of JavaScript. +Die oben beschriebene Logik ist sozusagen die klassische Variante. Nehmen wir jetzt die "speziellen" Features von JavaScript hinzu. -The extended algorithm works as follows. +Der erweiterte Algorithmus arbeitet wie folgt: -Given multiple OR'ed values: +Für mehrere mit ODER verknüpfte Werte: ```js result = value1 || value2 || value3; ``` -The OR `||` operator does the following: +arbeitet der Operator ODER `||` wie folgt: -- Evaluates operands from left to right. -- For each operand, converts it to boolean. If the result is `true`, stops and returns the original value of that operand. -- If all operands have been evaluated (i.e. all were `false`), returns the last operand. +- Wertet Operanden von links nach rechts aus. +- Konvertiert jeden Operand in einen Booleschen Wert. Ist das Ergebnis `true`, endet seine Auswertung und er gibt den ursprünglichen Wert dieses Operanden zurück. +- Sind alle Operanden ausgewertet ( d.h. alle waren `false` ), gibt er den letzten Operanden zurück. -A value is returned in its original form, without the conversion. +Ein Wert wird in seiner ursprünglichen Form zurückgegeben, ohne die Konvertierung. -In other words, a chain of OR `"||"` returns the first truthy value or the last one if no truthy value is found. +Mit anderen Worten, eine Folge von ODER `"||"` gibt den ersten effektiv wahren Wert zurück oder - sofern kein solcher gefunden wird - den letzten Wert. -For instance: +Beispiel: ```js run alert( 1 || 0 ); // 1 (1 is truthy) -alert( true || 'no matter what' ); // (true is truthy) +alert( true || 'egal was' ); // (true is effektiv wahr) -alert( null || 1 ); // 1 (1 is the first truthy value) -alert( null || 0 || 1 ); // 1 (the first truthy value) -alert( undefined || null || 0 ); // 0 (all falsy, returns the last value) +alert( null || 1 ); // 1 (1 ist der erste effektiv wahre Wert) +alert( null || 0 || 1 ); // 1 (der erste effektiv wahre Wert) +alert( undefined || null || 0 ); // 0 (alle effektiv falsch, gibt letzten Wert zurück) ``` -This leads to some interesting usage compared to a "pure, classical, boolean-only OR". +Das führt im Vergleich zu einem "reinen, klassischen, nur-Booleschen ODER" zu einigen interessanten Anwendungen: -1. **Getting the first truthy value from a list of variables or expressions.** +1. **Bestimme den ersten effektiv wahren Wert aus einer Liste von Variablen bzw. Ausdrücken.** - Imagine we have a list of variables which can either contain data or be `null/undefined`. How can we find the first one with data? + Nehmen wir an wir hätten eine Liste von Variablen, die entweder Daten beinhalten oder `null/undefined` sind. Wie finden wir die erste Variable mit Inhalt ? - We can use OR `||`: + Wir können ODER `||` nutzen: ```js run let currentUser = null; let defaultUser = "John"; *!* - let name = currentUser || defaultUser || "unnamed"; + let name = currentUser || defaultUser || "unbenannt"; */!* - alert( name ); // selects "John" – the first truthy value + alert( name ); // Gibt "John" aus – den ersten effektiv wahren Wert ``` - If both `currentUser` and `defaultUser` were falsy, `"unnamed"` would be the result. -2. **Short-circuit evaluation.** + Wären sowohl `currentUser` als auch `defaultUser` effektiv falsch, lautete das Ergebnis `"unbenannt"`. +2. **Partielle Auswertung ( Short-circuit evaluation ).** - Operands can be not only values, but arbitrary expressions. OR evaluates and tests them from left to right. The evaluation stops when a truthy value is reached, and the value is returned. This process is called "a short-circuit evaluation" because it goes as short as possible from left to right. - - This is clearly seen when the expression given as the second argument has a side effect like a variable assignment. - - In the example below, `x` does not get assigned: + Operanden können nicht nur Werte sondern beliebige Ausdrücke sein. ODER führt deren Auswertung und Test in der Reihenfolge von links nach rechts aus. Die Auswertung endet, wenn ein effektiv wahrer Wert erreicht wird, und dieser Wert wird zurückgegeben. Dieses Prinzip nennt man "partielle Auswertung" ( "short-circuit evaluation" ), da sie von links nach rechts fortschreitend frühestmöglich abbricht und ggf. nicht alle Operanden berücksichtigt. + + Das kann man klar erkennen, wenn der als zweites Argument gegebene Ausdruck einen Seiteneffekt produziert, wie etwa eine Variablenzuweisung. + + Im folgenden Beispiel wird `x` nicht zugewiesen: ```js run no-beautify let x; *!*true*/!* || (x = 1); - alert(x); // undefined, because (x = 1) not evaluated + alert(x); // undefined, denn (x = 1) wird nicht ausgewertet ``` - If, instead, the first argument is `false`, `||` evaluates the second one, thus running the assignment: + It hingegen das erste Argument `false`, wertet `||` das zweite aus und führt die Zuweisung durch: ```js run no-beautify let x; @@ -143,21 +143,21 @@ This leads to some interesting usage compared to a "pure, classical, boolean-onl alert(x); // 1 ``` - An assignment is a simple case. There may be side effects, that won't show up if the evaluation doesn't reach them. - - As we can see, such a use case is a "shorter way of doing `if`". The first operand is converted to boolean. If it's false, the second one is evaluated. + Eine Zuweisung ist ein einfacher Fall. Es kann Seiteneffekte geben, deren Ausbleiben sich nicht unmittelbar manifestiert, wenn die Auswertung sie nicht erreicht. - Most of time, it's better to use a "regular" `if` to keep the code easy to understand, but sometimes this can be handy. + Wir wir erkennen ist ein solcher Anwendungsfall eine verlürzte Fallunterschiedung mit `if`. Der erste Operand wird in einen Booleschen Wert konvertiert. Ist er `false`, wird der zweite Operand ausgewertet. + + Meistens ist ein "normales" `if` vorzuziehen, um den Code möglichst verständlich zu halten, manchmal kann die Kurzvariante aber ganz praktisch sein. -## && (AND) +## && (UND) -The AND operator is represented with two ampersands `&&`: +Der Operator "UND" wird mit zwei kaufmännischen Und-Symbolen (Ampersands) repräsentiert: ```js result = a && b; ``` -In classical programming, AND returns `true` if both operands are truthy and `false` otherwise: +In der klasssischen Programmierung gibt UND `true` zurück, wenn beide Operanden effektiv wahr sind, ansonsten `false`: ```js run alert( true && true ); // true @@ -166,138 +166,138 @@ alert( true && false ); // false alert( false && false ); // false ``` -An example with `if`: +Ein beispiel mit `if`: ```js run let hour = 12; let minute = 30; if (hour == 12 && minute == 30) { - alert( 'The time is 12:30' ); + alert( 'Es ist 12:30 Uhr' ); } ``` -Just as with OR, any value is allowed as an operand of AND: +Genau wie bei ODER ist jeder Wert als Operand von UND zulässig: ```js run -if (1 && 0) { // evaluated as true && false - alert( "won't work, because the result is falsy" ); +if (1 && 0) { // Interpretiert als true && false + alert( "Nie zu sehen, denn das Ergebnis war effektiv falsch." ); } ``` -## AND "&&" finds the first falsy value +## UND "&&" findet den ersten effektiv falschen Wert -Given multiple AND'ed values: +Für mehrere mit UND verknüpfte Werte: ```js result = value1 && value2 && value3; ``` -The AND `&&` operator does the following: +arbeitet der Operator UND `&&` wie folgt: -- Evaluates operands from left to right. -- For each operand, converts it to a boolean. If the result is `false`, stops and returns the original value of that operand. -- If all operands have been evaluated (i.e. all were truthy), returns the last operand. +- Wertet Operanden von links nach rechts aus. +- Konvertiert jeden Operand in einen Booleschen Wert. Ist das Ergebnis `false`, endet seine Auswertung und er gibt den ursprünglichen Wert dieses Operanden zurück. +- Sind alle Operanden ausgewertet ( d.h. alle waren effektiv wahr ), gibt er den letzten Operanden zurück. -In other words, AND returns the first falsy value or the last value if none were found. +Mit anderen Worten, UND gibt den ersten effektiv falschen Wert zurück oder - sofern kein solcher gefunden wird - den letzten Wert. -The rules above are similar to OR. The difference is that AND returns the first *falsy* value while OR returns the first *truthy* one. +Die Regeln sind ähnlich denen für ODER. Der Unterschied besteht darin, daß UND den ersten *effektiv falschen* Wert zurückgibt, während es bei ODER der erste *effektiv whare* ist. -Examples: +Beispiele: ```js run -// if the first operand is truthy, -// AND returns the second operand: +// Ist der erste Operand effektiv wahr, +// gibt UND den zweiten Operanden zurück: alert( 1 && 0 ); // 0 alert( 1 && 5 ); // 5 -// if the first operand is falsy, -// AND returns it. The second operand is ignored +// Ist der erste Operand effektiv falsch, +// gibt ihn UND zurück. Der zweite Operand wird ignoriert. alert( null && 5 ); // null alert( 0 && "no matter what" ); // 0 ``` -We can also pass several values in a row. See how the first falsy one is returned: +Wir können auch mehrere Werte am Stück verknüpfen. Hier sehen wir, wie der erste effektiv falsche Wert zurückgegeben wird. ```js run alert( 1 && 2 && null && 3 ); // null ``` -When all values are truthy, the last value is returned: +Wenn alle Werte effektiv wahr sind, wird der letzte Wert zurückgegeben: ```js run -alert( 1 && 2 && 3 ); // 3, the last one +alert( 1 && 2 && 3 ); // 3, der letzte Wert ``` -````smart header="Precedence of AND `&&` is higher than OR `||`" -The precedence of AND `&&` operator is higher than OR `||`. +````smart header="Präzedenz von UND `&&` ist höher als von ODER `||`" +Die Präzedenz der Operators UND `&&` ist höher als die von ODER `||`. -So the code `a && b || c && d` is essentially the same as if the `&&` expressions were in parentheses: `(a && b) || (c && d)`. +Der Code `a && b || c && d` verhält sich daher i.w. so, als ob die Ausdrücke mit `&&` in Klammern gesetzt würden: `(a && b) || (c && d)`. ```` -Just like OR, the AND `&&` operator can sometimes replace `if`. +So wie ODER kann auch der Operator UND `&&` manchmal eine Fallunterscheidung (`if`) ersetzen. -For instance: +Beispiel: ```js run let x = 1; -(x > 0) && alert( 'Greater than zero!' ); +(x > 0) && alert( 'Größer 0!' ); ``` -The action in the right part of `&&` would execute only if the evaluation reaches it. That is, only if `(x > 0)` is true. +Die Aktion im rechten Zweig von `&&` kommt nur zur Ausführung, wenn die Auswertung des Ausdrucks sie erreicht. Also nur falls `(x > 0)` wahr ist. -So we basically have an analogue for: +Damit haben wir im Prinzip ein Pendant zu: ```js run let x = 1; if (x > 0) { - alert( 'Greater than zero!' ); + alert( 'Größer 0!' ); } ``` -The variant with `&&` appears shorter. But `if` is more obvious and tends to be a little bit more readable. +Die Variante mit `&&` wirkt knapper. Aber `if` ist leichter zu identifizieren und tendenziell eines kleines bißchen verständlicher. -So we recommend using every construct for its purpose: use `if` if we want if and use `&&` if we want AND. +Daher empfehlen wir, jedes Konstrukt gemäß seinem Zweck einzusetzen: `if` nutzen, wenn wir eine Fallunterscheidung haben wollen, `&&` für die logische Operation UND. -## ! (NOT) +## ! (NICHT) -The boolean NOT operator is represented with an exclamation sign `!`. +Der Boolsche Operator NICHT wird durch ein Ausrufezeichen `!` repräsentiert -The syntax is pretty simple: +Die Syntax ist einfach genug: ```js result = !value; ``` -The operator accepts a single argument and does the following: +Der Operator akzeotiert ein einzelnes Argument und erledigt folgendes: -1. Converts the operand to boolean type: `true/false`. -2. Returns the inverse value. +1. Konvertiert den Operand in einen Booleschen Wert: `true/false`. +2. Gibt den negierten Wert zurück. -For instance: +Beispiel: ```js run alert( !true ); // false alert( !0 ); // true ``` -A double NOT `!!` is sometimes used for converting a value to boolean type: +Ein doppeltes NICHT `!!` verwendet man gelegentlich zur Konvertierung in einen Booleschen Wert: ```js run -alert( !!"non-empty string" ); // true +alert( !!"Nicht-leere Zeichenkette" ); // true alert( !!null ); // false ``` -That is, the first NOT converts the value to boolean and returns the inverse, and the second NOT inverses it again. In the end, we have a plain value-to-boolean conversion. +Das erste NICHT konvertiert den Wert in einen Booleschen Wert und gibt den negierten Wert zurück, während das zweite NICHT ein weiteres Mal negiert. Als Ergebnis erhalten wir die elementare Konvertierung eines Werts in einen Booleschen Wert. -There's a little more verbose way to do the same thing -- a built-in `Boolean` function: +Eine etwas ausführlichere Notation bewerkstelligt das gleiche -- die vordefinierte Funktion `Boolean`: ```js run -alert( Boolean("non-empty string") ); // true +alert( Boolean("Nicht-leere Zeichenkette") ); // true alert( Boolean(null) ); // false ``` -The precedence of NOT `!` is the highest of all logical operators, so it always executes first, before `&&` or `||`. +Die Präzedenz von NOT `!` ist die höchste aller logischen Operatoren, damit wird sie immer zuerst ausgeführt, vor `&&` oder `||`. From e5ca2f241ffa7960b4b94f2647eba6aeac09f1d8 Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 17 Mar 2020 14:55:06 +0100 Subject: [PATCH 03/41] First draft truthy/falsy -> effektiv wahr/unwahr. 'Effektiv falsch' has the connotation of being inadmissible semantically in a more pronounced way than 'effektiv true' has it for being semantically admissible; therefore 'effektiv unwahr' has been chosen for 'falsy'. --- .../11-logical-operators/article.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/1-js/02-first-steps/11-logical-operators/article.md b/1-js/02-first-steps/11-logical-operators/article.md index 7463f628a..489609b1f 100644 --- a/1-js/02-first-steps/11-logical-operators/article.md +++ b/1-js/02-first-steps/11-logical-operators/article.md @@ -16,7 +16,7 @@ result = a || b; In der klasssischen Programmierung dient das logische ODER nur zur Verarbeitung Boolescher Werte. Falls eines seiner Argumente `true` ist, liefert es `true`, andernfalls `false`. -In JavaScript ist der Operator etwas subtiler und mächtiger. Aber schauen wir uns zuerst an, was mit Booleschen Werten passiert. +In JavaScript ist der Operator mächtiger und in der Anwendung etwas diffiziler. Aber schauen wir uns zuerst an, was mit Booleschen Werten passiert. Es gibt vier mögliche logische Kombinationen: @@ -94,7 +94,7 @@ alert( true || 'egal was' ); // (true is effektiv wahr) alert( null || 1 ); // 1 (1 ist der erste effektiv wahre Wert) alert( null || 0 || 1 ); // 1 (der erste effektiv wahre Wert) -alert( undefined || null || 0 ); // 0 (alle effektiv falsch, gibt letzten Wert zurück) +alert( undefined || null || 0 ); // 0 (alle effektiv unwahr, gibt letzten Wert zurück) ``` Das führt im Vergleich zu einem "reinen, klassischen, nur-Booleschen ODER" zu einigen interessanten Anwendungen: @@ -116,7 +116,7 @@ Das führt im Vergleich zu einem "reinen, klassischen, nur-Booleschen ODER" zu e alert( name ); // Gibt "John" aus – den ersten effektiv wahren Wert ``` - Wären sowohl `currentUser` als auch `defaultUser` effektiv falsch, lautete das Ergebnis `"unbenannt"`. + Wären sowohl `currentUser` als auch `defaultUser` effektiv unwahr, lautete das Ergebnis `"unbenannt"`. 2. **Partielle Auswertung ( Short-circuit evaluation ).** Operanden können nicht nur Werte sondern beliebige Ausdrücke sein. ODER führt deren Auswertung und Test in der Reihenfolge von links nach rechts aus. Die Auswertung endet, wenn ein effektiv wahrer Wert erreicht wird, und dieser Wert wird zurückgegeben. Dieses Prinzip nennt man "partielle Auswertung" ( "short-circuit evaluation" ), da sie von links nach rechts fortschreitend frühestmöglich abbricht und ggf. nicht alle Operanden berücksichtigt. @@ -181,12 +181,12 @@ Genau wie bei ODER ist jeder Wert als Operand von UND zulässig: ```js run if (1 && 0) { // Interpretiert als true && false - alert( "Nie zu sehen, denn das Ergebnis war effektiv falsch." ); + alert( "Nie zu sehen, denn das Ergebnis war effektiv unwahr." ); } ``` -## UND "&&" findet den ersten effektiv falschen Wert +## UND "&&" findet den ersten effektiv unwahren Wert Für mehrere mit UND verknüpfte Werte: @@ -200,9 +200,9 @@ arbeitet der Operator UND `&&` wie folgt: - Konvertiert jeden Operand in einen Booleschen Wert. Ist das Ergebnis `false`, endet seine Auswertung und er gibt den ursprünglichen Wert dieses Operanden zurück. - Sind alle Operanden ausgewertet ( d.h. alle waren effektiv wahr ), gibt er den letzten Operanden zurück. -Mit anderen Worten, UND gibt den ersten effektiv falschen Wert zurück oder - sofern kein solcher gefunden wird - den letzten Wert. +Mit anderen Worten, UND gibt den ersten effektiv unwahren Wert zurück oder - sofern kein solcher gefunden wird - den letzten Wert. -Die Regeln sind ähnlich denen für ODER. Der Unterschied besteht darin, daß UND den ersten *effektiv falschen* Wert zurückgibt, während es bei ODER der erste *effektiv whare* ist. +Die Regeln sind ähnlich denen für ODER. Der Unterschied besteht darin, daß UND den ersten *effektiv unwahren* Wert zurückgibt, während es bei ODER der erste *effektiv whare* ist. Beispiele: @@ -212,13 +212,13 @@ Beispiele: alert( 1 && 0 ); // 0 alert( 1 && 5 ); // 5 -// Ist der erste Operand effektiv falsch, +// Ist der erste Operand effektiv unwahr, // gibt ihn UND zurück. Der zweite Operand wird ignoriert. alert( null && 5 ); // null alert( 0 && "no matter what" ); // 0 ``` -Wir können auch mehrere Werte am Stück verknüpfen. Hier sehen wir, wie der erste effektiv falsche Wert zurückgegeben wird. +Wir können auch mehrere Werte am Stück verknüpfen. Hier sehen wir, wie der erste effektiv unwahre Wert zurückgegeben wird. ```js run alert( 1 && 2 && null && 3 ); // null @@ -272,7 +272,7 @@ Die Syntax ist einfach genug: result = !value; ``` -Der Operator akzeotiert ein einzelnes Argument und erledigt folgendes: +Der Operator akzeptiert ein einzelnes Argument und erledigt folgendes: 1. Konvertiert den Operand in einen Booleschen Wert: `true/false`. 2. Gibt den negierten Wert zurück. From f96d32c055e6142025a0afdaefd79f7e0767002f Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 17 Mar 2020 14:56:04 +0100 Subject: [PATCH 04/41] Update solution.md --- .../11-logical-operators/1-alert-null-2-undefined/solution.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/02-first-steps/11-logical-operators/1-alert-null-2-undefined/solution.md b/1-js/02-first-steps/11-logical-operators/1-alert-null-2-undefined/solution.md index 8869d32e6..f04d45948 100644 --- a/1-js/02-first-steps/11-logical-operators/1-alert-null-2-undefined/solution.md +++ b/1-js/02-first-steps/11-logical-operators/1-alert-null-2-undefined/solution.md @@ -1,4 +1,4 @@ -The answer is `2`, that's the first truthy value. +Die Antwort lautet `2`, das ist der erste effektiv wahre Wert. ```js run alert( null || 2 || undefined ); From 2d243adf476fb8b2a13488104ce886d99a1e3808 Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 17 Mar 2020 14:57:22 +0100 Subject: [PATCH 05/41] Update task.md --- 1-js/02-first-steps/11-logical-operators/2-alert-or/task.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1-js/02-first-steps/11-logical-operators/2-alert-or/task.md b/1-js/02-first-steps/11-logical-operators/2-alert-or/task.md index 3908fa2ec..71c92d642 100644 --- a/1-js/02-first-steps/11-logical-operators/2-alert-or/task.md +++ b/1-js/02-first-steps/11-logical-operators/2-alert-or/task.md @@ -2,9 +2,9 @@ importance: 3 --- -# What's the result of OR'ed alerts? +# Was ergeben mit ODER verknüpfte `alert`-Aufrufe ? -What will the code below output? +Was gibt der untenstehende Code aus? ```js alert( alert(1) || 2 || alert(3) ); From 4c51d037a4e7c480f327768231a453624768fe66 Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 17 Mar 2020 15:02:27 +0100 Subject: [PATCH 06/41] Update solution.md --- .../11-logical-operators/2-alert-or/solution.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/1-js/02-first-steps/11-logical-operators/2-alert-or/solution.md b/1-js/02-first-steps/11-logical-operators/2-alert-or/solution.md index 8f4d664e8..823d134a4 100644 --- a/1-js/02-first-steps/11-logical-operators/2-alert-or/solution.md +++ b/1-js/02-first-steps/11-logical-operators/2-alert-or/solution.md @@ -1,13 +1,13 @@ -The answer: first `1`, then `2`. +Die Antwort: zuerst `1`, dann `2`. ```js run alert( alert(1) || 2 || alert(3) ); ``` -The call to `alert` does not return a value. Or, in other words, it returns `undefined`. +Der Aufruf von `alert` liefert keinen Wert zurück. Genauer formuliert liefert er `undefined`. -1. The first OR `||` evaluates it's left operand `alert(1)`. That shows the first message with `1`. -2. The `alert` returns `undefined`, so OR goes on to the second operand searching for a truthy value. -3. The second operand `2` is truthy, so the execution is halted, `2` is returned and then shown by the outer alert. +1. Das erste ODER `||` wertet seinen linke Operanden `alert(1)` aus. Das führt zur Anzeige der ersten Nachricht `1`. +2. Der Aufruf von `alert` liefert `undefined`, also setzt ODER die Suche nach einen effektiv wahren Wert mit dem zweiten Operanden fort. +3. Der zweite Operand `2` ist effektiv wahr, die Ausführung wird gestoppt, `2` wird zurückgegeben und mittels des äußeren `alert` angezeigt. -There will be no `3`, because the evaluation does not reach `alert(3)`. +`3` wird nicht angezeigt, da die Auswertung `alert(3)` nicht erreicht. From b7aa5b62a2daa3ad4065b03432a6cada79133a08 Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 17 Mar 2020 15:02:47 +0100 Subject: [PATCH 07/41] Update solution.md --- 1-js/02-first-steps/11-logical-operators/2-alert-or/solution.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/02-first-steps/11-logical-operators/2-alert-or/solution.md b/1-js/02-first-steps/11-logical-operators/2-alert-or/solution.md index 823d134a4..5acc24b3a 100644 --- a/1-js/02-first-steps/11-logical-operators/2-alert-or/solution.md +++ b/1-js/02-first-steps/11-logical-operators/2-alert-or/solution.md @@ -1,4 +1,4 @@ -Die Antwort: zuerst `1`, dann `2`. +Antwort: zuerst `1`, dann `2`. ```js run alert( alert(1) || 2 || alert(3) ); From b8067c69c1d1c9128834d91850504d9bc401bed4 Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 17 Mar 2020 15:03:37 +0100 Subject: [PATCH 08/41] Update task.md --- .../11-logical-operators/3-alert-1-null-2/task.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1-js/02-first-steps/11-logical-operators/3-alert-1-null-2/task.md b/1-js/02-first-steps/11-logical-operators/3-alert-1-null-2/task.md index 043d431e4..9495f51c9 100644 --- a/1-js/02-first-steps/11-logical-operators/3-alert-1-null-2/task.md +++ b/1-js/02-first-steps/11-logical-operators/3-alert-1-null-2/task.md @@ -2,9 +2,9 @@ importance: 5 --- -# What is the result of AND? +# Was ist das Ergebnis von UND? -What is this code going to show? +Was zeigt der untenstehende Code an? ```js alert( 1 && null && 2 ); From b0d0d01ec283189bd3f8270a0fb3cda78c67c3eb Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 17 Mar 2020 15:04:39 +0100 Subject: [PATCH 09/41] Update solution.md --- .../11-logical-operators/3-alert-1-null-2/solution.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/02-first-steps/11-logical-operators/3-alert-1-null-2/solution.md b/1-js/02-first-steps/11-logical-operators/3-alert-1-null-2/solution.md index 5c2455ef4..7191b9ad5 100644 --- a/1-js/02-first-steps/11-logical-operators/3-alert-1-null-2/solution.md +++ b/1-js/02-first-steps/11-logical-operators/3-alert-1-null-2/solution.md @@ -1,4 +1,4 @@ -The answer: `null`, because it's the first falsy value from the list. +Antwort: `null`, denn das ist der erste effektiv nicht wahre Wert aus der Liste. ```js run alert( 1 && null && 2 ); From b98325fa4d801b1ce807047e3b9924ce7f785adc Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 17 Mar 2020 15:05:21 +0100 Subject: [PATCH 10/41] Update solution.md --- 1-js/02-first-steps/11-logical-operators/2-alert-or/solution.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/02-first-steps/11-logical-operators/2-alert-or/solution.md b/1-js/02-first-steps/11-logical-operators/2-alert-or/solution.md index 5acc24b3a..5899d4cc1 100644 --- a/1-js/02-first-steps/11-logical-operators/2-alert-or/solution.md +++ b/1-js/02-first-steps/11-logical-operators/2-alert-or/solution.md @@ -6,7 +6,7 @@ alert( alert(1) || 2 || alert(3) ); Der Aufruf von `alert` liefert keinen Wert zurück. Genauer formuliert liefert er `undefined`. -1. Das erste ODER `||` wertet seinen linke Operanden `alert(1)` aus. Das führt zur Anzeige der ersten Nachricht `1`. +1. Das erste ODER `||` wertet seinen linken Operanden `alert(1)` aus. Das führt zur Anzeige der ersten Nachricht `1`. 2. Der Aufruf von `alert` liefert `undefined`, also setzt ODER die Suche nach einen effektiv wahren Wert mit dem zweiten Operanden fort. 3. Der zweite Operand `2` ist effektiv wahr, die Ausführung wird gestoppt, `2` wird zurückgegeben und mittels des äußeren `alert` angezeigt. From e449c42a61d22c25a69dd4faf0e64ea2b2e30041 Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 17 Mar 2020 15:07:25 +0100 Subject: [PATCH 11/41] Improved wording 'effektiv unwahr' -> 'effektiv nicht wahr'. General rationale for translation of 'falsy' see previous commit. --- .../11-logical-operators/article.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/1-js/02-first-steps/11-logical-operators/article.md b/1-js/02-first-steps/11-logical-operators/article.md index 489609b1f..00a066fa8 100644 --- a/1-js/02-first-steps/11-logical-operators/article.md +++ b/1-js/02-first-steps/11-logical-operators/article.md @@ -94,7 +94,7 @@ alert( true || 'egal was' ); // (true is effektiv wahr) alert( null || 1 ); // 1 (1 ist der erste effektiv wahre Wert) alert( null || 0 || 1 ); // 1 (der erste effektiv wahre Wert) -alert( undefined || null || 0 ); // 0 (alle effektiv unwahr, gibt letzten Wert zurück) +alert( undefined || null || 0 ); // 0 (alle effektiv nicht wahr, gibt letzten Wert zurück) ``` Das führt im Vergleich zu einem "reinen, klassischen, nur-Booleschen ODER" zu einigen interessanten Anwendungen: @@ -116,7 +116,7 @@ Das führt im Vergleich zu einem "reinen, klassischen, nur-Booleschen ODER" zu e alert( name ); // Gibt "John" aus – den ersten effektiv wahren Wert ``` - Wären sowohl `currentUser` als auch `defaultUser` effektiv unwahr, lautete das Ergebnis `"unbenannt"`. + Wären sowohl `currentUser` als auch `defaultUser` effektiv nicht wahr, lautete das Ergebnis `"unbenannt"`. 2. **Partielle Auswertung ( Short-circuit evaluation ).** Operanden können nicht nur Werte sondern beliebige Ausdrücke sein. ODER führt deren Auswertung und Test in der Reihenfolge von links nach rechts aus. Die Auswertung endet, wenn ein effektiv wahrer Wert erreicht wird, und dieser Wert wird zurückgegeben. Dieses Prinzip nennt man "partielle Auswertung" ( "short-circuit evaluation" ), da sie von links nach rechts fortschreitend frühestmöglich abbricht und ggf. nicht alle Operanden berücksichtigt. @@ -181,12 +181,12 @@ Genau wie bei ODER ist jeder Wert als Operand von UND zulässig: ```js run if (1 && 0) { // Interpretiert als true && false - alert( "Nie zu sehen, denn das Ergebnis war effektiv unwahr." ); + alert( "Nie zu sehen, denn das Ergebnis war effektiv nicht wahr." ); } ``` -## UND "&&" findet den ersten effektiv unwahren Wert +## UND "&&" findet den ersten effektiv nicht wahren Wert Für mehrere mit UND verknüpfte Werte: @@ -200,9 +200,9 @@ arbeitet der Operator UND `&&` wie folgt: - Konvertiert jeden Operand in einen Booleschen Wert. Ist das Ergebnis `false`, endet seine Auswertung und er gibt den ursprünglichen Wert dieses Operanden zurück. - Sind alle Operanden ausgewertet ( d.h. alle waren effektiv wahr ), gibt er den letzten Operanden zurück. -Mit anderen Worten, UND gibt den ersten effektiv unwahren Wert zurück oder - sofern kein solcher gefunden wird - den letzten Wert. +Mit anderen Worten, UND gibt den ersten effektiv nicht wahren Wert zurück oder - sofern kein solcher gefunden wird - den letzten Wert. -Die Regeln sind ähnlich denen für ODER. Der Unterschied besteht darin, daß UND den ersten *effektiv unwahren* Wert zurückgibt, während es bei ODER der erste *effektiv whare* ist. +Die Regeln sind ähnlich denen für ODER. Der Unterschied besteht darin, daß UND den ersten *effektiv nicht wahren* Wert zurückgibt, während es bei ODER der erste *effektiv whare* ist. Beispiele: @@ -212,13 +212,13 @@ Beispiele: alert( 1 && 0 ); // 0 alert( 1 && 5 ); // 5 -// Ist der erste Operand effektiv unwahr, +// Ist der erste Operand effektiv nicht wahr, // gibt ihn UND zurück. Der zweite Operand wird ignoriert. alert( null && 5 ); // null alert( 0 && "no matter what" ); // 0 ``` -Wir können auch mehrere Werte am Stück verknüpfen. Hier sehen wir, wie der erste effektiv unwahre Wert zurückgegeben wird. +Wir können auch mehrere Werte am Stück verknüpfen. Hier sehen wir, wie der erste effektiv nicht wahre Wert zurückgegeben wird. ```js run alert( 1 && 2 && null && 3 ); // null From bec311857cc767fdc617f61f636a97db29e28370 Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 17 Mar 2020 15:08:36 +0100 Subject: [PATCH 12/41] Update task.md --- 1-js/02-first-steps/11-logical-operators/4-alert-and/task.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1-js/02-first-steps/11-logical-operators/4-alert-and/task.md b/1-js/02-first-steps/11-logical-operators/4-alert-and/task.md index 69f877b95..6c4f5fc4a 100644 --- a/1-js/02-first-steps/11-logical-operators/4-alert-and/task.md +++ b/1-js/02-first-steps/11-logical-operators/4-alert-and/task.md @@ -2,9 +2,9 @@ importance: 3 --- -# What is the result of AND'ed alerts? +# Was ist das Ergebnis mit UND verknüpfter `alert`-Aufrufe? -What will this code show? +Was gibt untenstehender Code aus? ```js alert( alert(1) && alert(2) ); From 4a6af6294ea1393b28e78e35b4215563aea84ac2 Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 17 Mar 2020 15:12:14 +0100 Subject: [PATCH 13/41] Update solution.md --- .../11-logical-operators/4-alert-and/solution.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/1-js/02-first-steps/11-logical-operators/4-alert-and/solution.md b/1-js/02-first-steps/11-logical-operators/4-alert-and/solution.md index b6fb10d72..64efc4d6a 100644 --- a/1-js/02-first-steps/11-logical-operators/4-alert-and/solution.md +++ b/1-js/02-first-steps/11-logical-operators/4-alert-and/solution.md @@ -1,10 +1,10 @@ -The answer: `1`, and then `undefined`. +Antwort: `1`, anschließend `undefined`. ```js run alert( alert(1) && alert(2) ); ``` -The call to `alert` returns `undefined` (it just shows a message, so there's no meaningful return). +Der Aufruf von `alert` gibt `undefined` zurück (Die Funktion gibt nur eine Nachricht aus, ohne Rückgabewert). -Because of that, `&&` evaluates the left operand (outputs `1`), and immediately stops, because `undefined` is a falsy value. And `&&` looks for a falsy value and returns it, so it's done. +Deswegen wertet `&&` den linken Operanden aus (Ausgabe von `1`) und terminiert unmittelbar, da `undefined` ein effektiv nicht wahrer Wert ist. `&&` wiederum sucht nach einem effektiv nicht wahren Wert und gibt ihn zurück, das beendet somit die Auswertung. From f4c25470b633b9791387e4f5995e0b1146073b9d Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 17 Mar 2020 15:12:54 +0100 Subject: [PATCH 14/41] Update task.md --- .../11-logical-operators/5-alert-and-or/task.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1-js/02-first-steps/11-logical-operators/5-alert-and-or/task.md b/1-js/02-first-steps/11-logical-operators/5-alert-and-or/task.md index b18bb9c51..14ebe317f 100644 --- a/1-js/02-first-steps/11-logical-operators/5-alert-and-or/task.md +++ b/1-js/02-first-steps/11-logical-operators/5-alert-and-or/task.md @@ -2,9 +2,9 @@ importance: 5 --- -# The result of OR AND OR +# Das Ergebnis von ODER UND ODER -What will the result be? +Was ist das Ergebnis? ```js alert( null || 2 && 3 || 4 ); From fe43dbf3ac9c8c8040753c2630f9681373df44ff Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 17 Mar 2020 15:15:18 +0100 Subject: [PATCH 15/41] Update solution.md --- .../11-logical-operators/5-alert-and-or/solution.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/1-js/02-first-steps/11-logical-operators/5-alert-and-or/solution.md b/1-js/02-first-steps/11-logical-operators/5-alert-and-or/solution.md index 25e3568f8..d2ad14daa 100644 --- a/1-js/02-first-steps/11-logical-operators/5-alert-and-or/solution.md +++ b/1-js/02-first-steps/11-logical-operators/5-alert-and-or/solution.md @@ -1,16 +1,16 @@ -The answer: `3`. +Antwort: `3`. ```js run alert( null || 2 && 3 || 4 ); ``` -The precedence of AND `&&` is higher than `||`, so it executes first. +Die Präzedenz von UND `&&` ist höher als die von `||`, deswegen wird UND zuerst ausgeführt. -The result of `2 && 3 = 3`, so the expression becomes: +Das Ergebnis von `2 && 3` lautet `3`, damit wird der Ausdruck zu: ``` null || 3 || 4 ``` -Now the result is the first truthy value: `3`. +Das Ergebnis ist dann der erste effektiv wahre Wert: `3`. From d69a0b4e15c948f360fe64c39b1586244ffd88de Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 17 Mar 2020 15:17:43 +0100 Subject: [PATCH 16/41] Update task.md --- .../11-logical-operators/6-check-if-in-range/task.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/1-js/02-first-steps/11-logical-operators/6-check-if-in-range/task.md b/1-js/02-first-steps/11-logical-operators/6-check-if-in-range/task.md index cc00ca9fc..7501738da 100644 --- a/1-js/02-first-steps/11-logical-operators/6-check-if-in-range/task.md +++ b/1-js/02-first-steps/11-logical-operators/6-check-if-in-range/task.md @@ -2,8 +2,6 @@ importance: 3 --- -# Check the range between +# Bereichsprüfung -Write an "if" condition to check that `age` is between `14` and `90` inclusively. - -"Inclusively" means that `age` can reach the edges `14` or `90`. +Schreibe die Bedingung für eine Fallunterscheidung mit `if` um zu prüfen, daß `age` zwischen `14` and `90` liegt (Grenzen inklusive, `age` kann also die Werte `14` und `90` annehmen). From 160179e85cbe63233ba9e3c8447b042b28ceb003 Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 17 Mar 2020 15:18:30 +0100 Subject: [PATCH 17/41] Update task.md --- .../11-logical-operators/6-check-if-in-range/task.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/02-first-steps/11-logical-operators/6-check-if-in-range/task.md b/1-js/02-first-steps/11-logical-operators/6-check-if-in-range/task.md index 7501738da..d692bca9f 100644 --- a/1-js/02-first-steps/11-logical-operators/6-check-if-in-range/task.md +++ b/1-js/02-first-steps/11-logical-operators/6-check-if-in-range/task.md @@ -2,6 +2,6 @@ importance: 3 --- -# Bereichsprüfung +# Bereichsprüfung (positiv) Schreibe die Bedingung für eine Fallunterscheidung mit `if` um zu prüfen, daß `age` zwischen `14` and `90` liegt (Grenzen inklusive, `age` kann also die Werte `14` und `90` annehmen). From c07bd39baac723f98fa60e6b30669095f8cf086b Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 17 Mar 2020 15:20:15 +0100 Subject: [PATCH 18/41] Update task.md --- .../11-logical-operators/7-check-if-out-range/task.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/1-js/02-first-steps/11-logical-operators/7-check-if-out-range/task.md b/1-js/02-first-steps/11-logical-operators/7-check-if-out-range/task.md index 7c22d6ad1..3dcd9c486 100644 --- a/1-js/02-first-steps/11-logical-operators/7-check-if-out-range/task.md +++ b/1-js/02-first-steps/11-logical-operators/7-check-if-out-range/task.md @@ -2,8 +2,8 @@ importance: 3 --- -# Check the range outside +# Bereichsprüfung (negativ) -Write an `if` condition to check that `age` is NOT between 14 and 90 inclusively. +Schreibe die Bedingung für eine Fallunterscheidung mit `if` um zu prüfen, daß `age` NICHT zwischen `14` and `90` liegt (Grenzen inklusive). -Create two variants: the first one using NOT `!`, the second one -- without it. +Formuliere 2 Varianten, die erste mit NICHT `!`, die zweite -- ohne. From a538cff0d4b40b15c68cc85c24fd8d6c3a5cf00d Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 17 Mar 2020 15:20:42 +0100 Subject: [PATCH 19/41] Update solution.md --- .../11-logical-operators/7-check-if-out-range/solution.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1-js/02-first-steps/11-logical-operators/7-check-if-out-range/solution.md b/1-js/02-first-steps/11-logical-operators/7-check-if-out-range/solution.md index d1946a967..009a7654f 100644 --- a/1-js/02-first-steps/11-logical-operators/7-check-if-out-range/solution.md +++ b/1-js/02-first-steps/11-logical-operators/7-check-if-out-range/solution.md @@ -1,10 +1,10 @@ -The first variant: +Erste Variante: ```js if (!(age >= 14 && age <= 90)) ``` -The second variant: +Zweite Variante: ```js if (age < 14 || age > 90) From 6971d47923fec67b459b53a7be62803709cb1d00 Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 17 Mar 2020 15:22:23 +0100 Subject: [PATCH 20/41] Update task.md --- .../11-logical-operators/8-if-question/task.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/1-js/02-first-steps/11-logical-operators/8-if-question/task.md b/1-js/02-first-steps/11-logical-operators/8-if-question/task.md index 55987121b..2ee3eacf1 100644 --- a/1-js/02-first-steps/11-logical-operators/8-if-question/task.md +++ b/1-js/02-first-steps/11-logical-operators/8-if-question/task.md @@ -2,15 +2,15 @@ importance: 5 --- -# A question about "if" +# Eine Frage zu "if" -Which of these `alert`s are going to execute? +Welche der fogenden `alert`-Aufrufe werden ausgeführt? -What will the results of the expressions be inside `if(...)`? +Was sind die Ergebnisse der Ausdrücke in den Bedingungen `if(...)`? ```js -if (-1 || 0) alert( 'first' ); -if (-1 && 0) alert( 'second' ); -if (null || -1 && 1) alert( 'third' ); +if (-1 || 0) alert( 'Erster' ); +if (-1 && 0) alert( 'Zweiter' ); +if (null || -1 && 1) alert( 'Dritter' ); ``` From b531c02f97a1cb3352f4dd223bb1c7fdf9640ffb Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 17 Mar 2020 15:25:00 +0100 Subject: [PATCH 21/41] Update solution.md --- .../8-if-question/solution.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/1-js/02-first-steps/11-logical-operators/8-if-question/solution.md b/1-js/02-first-steps/11-logical-operators/8-if-question/solution.md index 210509758..f38fe2aa1 100644 --- a/1-js/02-first-steps/11-logical-operators/8-if-question/solution.md +++ b/1-js/02-first-steps/11-logical-operators/8-if-question/solution.md @@ -1,20 +1,20 @@ -The answer: the first and the third will execute. +Antwort: Erster und dritter Aufruf werde ausgeführt. Details: ```js run -// Runs. -// The result of -1 || 0 = -1, truthy -if (-1 || 0) alert( 'first' ); +// Ausgeführt. +// The result of -1 || 0 = -1, effektiv wahr +if (-1 || 0) alert( 'Erster' ); -// Doesn't run -// -1 && 0 = 0, falsy -if (-1 && 0) alert( 'second' ); +// Nicht ausgeführt +// -1 && 0 = 0, effektiv nicht wahr +if (-1 && 0) alert( 'Zweiter' ); -// Executes -// Operator && has a higher precedence than || -// so -1 && 1 executes first, giving us the chain: +// Ausgeführt +// Operator && hat höhere Präzedenz als ||, +// damit wird -1 && 1 zuerst ausgewertet, mit der Auswertereihung: // null || -1 && 1 -> null || 1 -> 1 -if (null || -1 && 1) alert( 'third' ); +if (null || -1 && 1) alert( 'Dritter' ); ``` From ed48368b713b1b1a1b4c5abe58cf9245f9b1e110 Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 17 Mar 2020 15:35:05 +0100 Subject: [PATCH 22/41] Update task.md --- .../9-check-login/task.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/1-js/02-first-steps/11-logical-operators/9-check-login/task.md b/1-js/02-first-steps/11-logical-operators/9-check-login/task.md index 290a52642..244dc74be 100644 --- a/1-js/02-first-steps/11-logical-operators/9-check-login/task.md +++ b/1-js/02-first-steps/11-logical-operators/9-check-login/task.md @@ -2,24 +2,24 @@ importance: 3 --- -# Check the login +# Login-Prüfung -Write the code which asks for a login with `prompt`. +Schreibe Code der mit `prompt` nach Anmeldedaten fragt. -If the visitor enters `"Admin"`, then `prompt` for a password, if the input is an empty line or `key:Esc` -- show "Canceled", if it's another string -- then show "I don't know you". +Gibt der Benutzer `"Admin"` ein, dann frage per `prompt` nach einem Passwort, ist die Eingabe eine Leerzeile oder `key:Esc` -- gib "Abbruch" aus, ist sie eine andere Zeichenkette -- dann gib aus "Diesen Nutzer kenne ich nicht". -The password is checked as follows: +Das Passwort wird wie folgt geprüft: -- If it equals "TheMaster", then show "Welcome!", -- Another string -- show "Wrong password", -- For an empty string or cancelled input, show "Canceled" +- Ist es "TheMaster", dann antworte mit "Willkommen!", +- Reagiere auf jede andere nicht-leere Zeichenkette mit der Anzeige -- "Falsches Passwort", +- Bei leerer Eingabzeile oder abgebrichener Eingabe zeige "Abbruch" an. -The schema: +Als Struktogramm: ![](ifelse_task.svg) -Please use nested `if` blocks. Mind the overall readability of the code. +Verwende eingerückte `if`-Blöcke und beachte die allgemeine Lesbarkeit des Codes. -Hint: passing an empty input to a prompt returns an empty string `''`. Pressing `key:ESC` during a prompt returns `null`. +Hinweis (Eingabeaufforderung): Eine leere Eingabe liefert die leere Zeichenkette `''`. Wird die Taste `key:ESC` betätigt, ist der Rückgabewert `null`. [demo] From 3be9e1c68d8a906836cecea6c526597926b9d95d Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 17 Mar 2020 15:38:14 +0100 Subject: [PATCH 23/41] Update solution.md --- .../9-check-login/solution.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/1-js/02-first-steps/11-logical-operators/9-check-login/solution.md b/1-js/02-first-steps/11-logical-operators/9-check-login/solution.md index a30db7aae..3f8d2da9b 100644 --- a/1-js/02-first-steps/11-logical-operators/9-check-login/solution.md +++ b/1-js/02-first-steps/11-logical-operators/9-check-login/solution.md @@ -1,25 +1,25 @@ ```js run demo -let userName = prompt("Who's there?", ''); +let userName = prompt("Wer da?", ''); if (userName == 'Admin') { - let pass = prompt('Password?', ''); + let pass = prompt('Passwort?', ''); if (pass == 'TheMaster') { - alert( 'Welcome!' ); + alert( 'Willkommen!' ); } else if (pass == '' || pass == null) { - alert( 'Canceled' ); + alert( 'Abbruch' ); } else { - alert( 'Wrong password' ); + alert( 'Falsches Passwort' ); } } else if (userName == '' || userName == null) { - alert( 'Canceled' ); + alert( 'Abbruch' ); } else { - alert( "I don't know you" ); + alert( "Ich kenne Sie nicht!" ); } ``` -Note the vertical indents inside the `if` blocks. They are technically not required, but make the code more readable. +Achte auf die vertikalen Einrückungen innerhalb des `if`-Blocks, die syntaktisch nicht zwingend sind, aber den Code lesbarer machen. From b49ff9fbd709beefe92d7b519d1e750a8454a735 Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 17 Mar 2020 15:38:38 +0100 Subject: [PATCH 24/41] Update task.md --- 1-js/02-first-steps/11-logical-operators/9-check-login/task.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/02-first-steps/11-logical-operators/9-check-login/task.md b/1-js/02-first-steps/11-logical-operators/9-check-login/task.md index 244dc74be..214a37e84 100644 --- a/1-js/02-first-steps/11-logical-operators/9-check-login/task.md +++ b/1-js/02-first-steps/11-logical-operators/9-check-login/task.md @@ -6,7 +6,7 @@ importance: 3 Schreibe Code der mit `prompt` nach Anmeldedaten fragt. -Gibt der Benutzer `"Admin"` ein, dann frage per `prompt` nach einem Passwort, ist die Eingabe eine Leerzeile oder `key:Esc` -- gib "Abbruch" aus, ist sie eine andere Zeichenkette -- dann gib aus "Diesen Nutzer kenne ich nicht". +Gibt der Benutzer `"Admin"` ein, dann frage per `prompt` nach einem Passwort, ist die Eingabe eine Leerzeile oder `key:Esc` -- gib "Abbruch" aus, ist sie eine andere Zeichenkette -- dann gib aus "Ich kenne Sie nicht!". Das Passwort wird wie folgt geprüft: From 34990ad6d387322a7c2a335a97fca90b2110b9c8 Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 17 Mar 2020 15:45:02 +0100 Subject: [PATCH 25/41] Update ifelse_task.svg --- .../9-check-login/ifelse_task.svg | 102 +++++++++++++++++- 1 file changed, 101 insertions(+), 1 deletion(-) diff --git a/1-js/02-first-steps/11-logical-operators/9-check-login/ifelse_task.svg b/1-js/02-first-steps/11-logical-operators/9-check-login/ifelse_task.svg index ca3e0aead..5de550b44 100644 --- a/1-js/02-first-steps/11-logical-operators/9-check-login/ifelse_task.svg +++ b/1-js/02-first-steps/11-logical-operators/9-check-login/ifelse_task.svg @@ -1 +1,101 @@ -BeginCanceledCanceledWelcome!I don't know youWrong passwordWho's there?Password?CancelCancelAdminTheMasterOtherOther \ No newline at end of file + + + + + + + + + + + + Start + + + + + + Abbruch + + + + + + Abbruch + + + + + + Willkommen! + + + + + + Ich kenne Sie nicht! + + + + + + Falsches Passwort + + + + + + + + + Wer da? + + + + + + Passwort? + + + + + + Abbruch + + + + + + Abbruch + + + + + + Admin + + + + + + TheMaster + + + + + + + + Sonstige + + + + + + Sonstige + + + + + From 1155f2247a27997d32daa2777acbc92e8a09ceb2 Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 17 Mar 2020 15:46:04 +0100 Subject: [PATCH 26/41] Update ifelse_task.svg --- .../11-logical-operators/9-check-login/ifelse_task.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/02-first-steps/11-logical-operators/9-check-login/ifelse_task.svg b/1-js/02-first-steps/11-logical-operators/9-check-login/ifelse_task.svg index 5de550b44..c5e14c3c1 100644 --- a/1-js/02-first-steps/11-logical-operators/9-check-login/ifelse_task.svg +++ b/1-js/02-first-steps/11-logical-operators/9-check-login/ifelse_task.svg @@ -10,7 +10,7 @@ - Start + Start From f1e7c21021438192bf64db192317d96ce3d4ed60 Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 17 Mar 2020 15:46:44 +0100 Subject: [PATCH 27/41] Update ifelse_task.svg --- .../11-logical-operators/9-check-login/ifelse_task.svg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1-js/02-first-steps/11-logical-operators/9-check-login/ifelse_task.svg b/1-js/02-first-steps/11-logical-operators/9-check-login/ifelse_task.svg index c5e14c3c1..873980e6a 100644 --- a/1-js/02-first-steps/11-logical-operators/9-check-login/ifelse_task.svg +++ b/1-js/02-first-steps/11-logical-operators/9-check-login/ifelse_task.svg @@ -10,7 +10,7 @@ - Start + Start @@ -49,7 +49,7 @@ - Wer da? + Wer da? From 9117c0956c4c5c2038a9c0a53735e2572dc8c481 Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 17 Mar 2020 15:48:10 +0100 Subject: [PATCH 28/41] Update ifelse_task.svg --- .../11-logical-operators/9-check-login/ifelse_task.svg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1-js/02-first-steps/11-logical-operators/9-check-login/ifelse_task.svg b/1-js/02-first-steps/11-logical-operators/9-check-login/ifelse_task.svg index 873980e6a..55c613797 100644 --- a/1-js/02-first-steps/11-logical-operators/9-check-login/ifelse_task.svg +++ b/1-js/02-first-steps/11-logical-operators/9-check-login/ifelse_task.svg @@ -28,7 +28,7 @@ - Willkommen! + Willkommen! @@ -49,7 +49,7 @@ - Wer da? + Wer da? From 6c20930ce0b744730b88d77ee6150297f9d3fb60 Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 17 Mar 2020 15:49:05 +0100 Subject: [PATCH 29/41] Update ifelse_task.svg --- .../11-logical-operators/9-check-login/ifelse_task.svg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1-js/02-first-steps/11-logical-operators/9-check-login/ifelse_task.svg b/1-js/02-first-steps/11-logical-operators/9-check-login/ifelse_task.svg index 55c613797..5dba8f01d 100644 --- a/1-js/02-first-steps/11-logical-operators/9-check-login/ifelse_task.svg +++ b/1-js/02-first-steps/11-logical-operators/9-check-login/ifelse_task.svg @@ -40,7 +40,7 @@ - Falsches Passwort + Falsches Passwort @@ -55,7 +55,7 @@ - Passwort? + Passwort? From fc8f68b2ca34a20d1ee73531390096b3d9ca5df4 Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 17 Mar 2020 15:50:09 +0100 Subject: [PATCH 30/41] Update ifelse_task.svg --- .../11-logical-operators/9-check-login/ifelse_task.svg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1-js/02-first-steps/11-logical-operators/9-check-login/ifelse_task.svg b/1-js/02-first-steps/11-logical-operators/9-check-login/ifelse_task.svg index 5dba8f01d..e4843087d 100644 --- a/1-js/02-first-steps/11-logical-operators/9-check-login/ifelse_task.svg +++ b/1-js/02-first-steps/11-logical-operators/9-check-login/ifelse_task.svg @@ -28,7 +28,7 @@ - Willkommen! + Willkommen! @@ -40,7 +40,7 @@ - Falsches Passwort + Falsches Passwort From 45a4c39d98647fb29d86ea83bee91e778dc72007 Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 17 Mar 2020 15:50:44 +0100 Subject: [PATCH 31/41] Update ifelse_task.svg --- .../11-logical-operators/9-check-login/ifelse_task.svg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1-js/02-first-steps/11-logical-operators/9-check-login/ifelse_task.svg b/1-js/02-first-steps/11-logical-operators/9-check-login/ifelse_task.svg index e4843087d..94f75ed7d 100644 --- a/1-js/02-first-steps/11-logical-operators/9-check-login/ifelse_task.svg +++ b/1-js/02-first-steps/11-logical-operators/9-check-login/ifelse_task.svg @@ -28,7 +28,7 @@ - Willkommen! + Willkommen! @@ -40,7 +40,7 @@ - Falsches Passwort + Falsches Passwort From a7122459cb57338aede6c13311cee37d13e58edc Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Sun, 5 Apr 2020 16:53:36 +0200 Subject: [PATCH 32/41] Review issues / update #1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Christian Hegedüs --- .../11-logical-operators/7-check-if-out-range/task.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/02-first-steps/11-logical-operators/7-check-if-out-range/task.md b/1-js/02-first-steps/11-logical-operators/7-check-if-out-range/task.md index 3dcd9c486..2036a0efc 100644 --- a/1-js/02-first-steps/11-logical-operators/7-check-if-out-range/task.md +++ b/1-js/02-first-steps/11-logical-operators/7-check-if-out-range/task.md @@ -4,6 +4,6 @@ importance: 3 # Bereichsprüfung (negativ) -Schreibe die Bedingung für eine Fallunterscheidung mit `if` um zu prüfen, daß `age` NICHT zwischen `14` and `90` liegt (Grenzen inklusive). +Schreibe die Bedingung für eine Fallunterscheidung mit `if` um zu prüfen, daß `age` NICHT zwischen `14` und `90` liegt (Grenzen inklusive). Formuliere 2 Varianten, die erste mit NICHT `!`, die zweite -- ohne. From 3fc66936df830dfd142809c8469883ee32a1a24a Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Sun, 5 Apr 2020 16:54:05 +0200 Subject: [PATCH 33/41] Review issues / update #2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Christian Hegedüs --- 1-js/02-first-steps/11-logical-operators/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/02-first-steps/11-logical-operators/article.md b/1-js/02-first-steps/11-logical-operators/article.md index 00a066fa8..1f1e229f8 100644 --- a/1-js/02-first-steps/11-logical-operators/article.md +++ b/1-js/02-first-steps/11-logical-operators/article.md @@ -90,7 +90,7 @@ Beispiel: ```js run alert( 1 || 0 ); // 1 (1 is truthy) -alert( true || 'egal was' ); // (true is effektiv wahr) +alert( true || 'egal was' ); // (true ist effektiv wahr) alert( null || 1 ); // 1 (1 ist der erste effektiv wahre Wert) alert( null || 0 || 1 ); // 1 (der erste effektiv wahre Wert) From 4fe03cb672db930707d3515c27314d47927ad532 Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Sun, 5 Apr 2020 16:54:38 +0200 Subject: [PATCH 34/41] Review issues / update #1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Christian Hegedüs --- 1-js/02-first-steps/11-logical-operators/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/02-first-steps/11-logical-operators/article.md b/1-js/02-first-steps/11-logical-operators/article.md index 1f1e229f8..7fc13bbd7 100644 --- a/1-js/02-first-steps/11-logical-operators/article.md +++ b/1-js/02-first-steps/11-logical-operators/article.md @@ -145,7 +145,7 @@ Das führt im Vergleich zu einem "reinen, klassischen, nur-Booleschen ODER" zu e Eine Zuweisung ist ein einfacher Fall. Es kann Seiteneffekte geben, deren Ausbleiben sich nicht unmittelbar manifestiert, wenn die Auswertung sie nicht erreicht. - Wir wir erkennen ist ein solcher Anwendungsfall eine verlürzte Fallunterschiedung mit `if`. Der erste Operand wird in einen Booleschen Wert konvertiert. Ist er `false`, wird der zweite Operand ausgewertet. + Wie wir erkennen ist ein solcher Anwendungsfall eine verkürzte Fallunterschiedung mit `if`. Der erste Operand wird in einen Booleschen Wert konvertiert. Ist er `false`, wird der zweite Operand ausgewertet. Meistens ist ein "normales" `if` vorzuziehen, um den Code möglichst verständlich zu halten, manchmal kann die Kurzvariante aber ganz praktisch sein. From fa2d1aa979a35eb992ed8e7043312b824b934986 Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Sun, 5 Apr 2020 16:55:08 +0200 Subject: [PATCH 35/41] Review issues / update #4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Christian Hegedüs --- .../11-logical-operators/8-if-question/solution.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/1-js/02-first-steps/11-logical-operators/8-if-question/solution.md b/1-js/02-first-steps/11-logical-operators/8-if-question/solution.md index f38fe2aa1..35faef742 100644 --- a/1-js/02-first-steps/11-logical-operators/8-if-question/solution.md +++ b/1-js/02-first-steps/11-logical-operators/8-if-question/solution.md @@ -1,4 +1,4 @@ -Antwort: Erster und dritter Aufruf werde ausgeführt. +Antwort: Erster und dritter Aufruf werden ausgeführt. Details: @@ -17,4 +17,3 @@ if (-1 && 0) alert( 'Zweiter' ); // null || -1 && 1 -> null || 1 -> 1 if (null || -1 && 1) alert( 'Dritter' ); ``` - From d2a771274074719d84ab785be2d1939b7fdf9de5 Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Sun, 5 Apr 2020 17:04:01 +0200 Subject: [PATCH 36/41] Review issues / update #5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Christian Hegedüs --- 1-js/02-first-steps/11-logical-operators/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/02-first-steps/11-logical-operators/article.md b/1-js/02-first-steps/11-logical-operators/article.md index 7fc13bbd7..1a7680dde 100644 --- a/1-js/02-first-steps/11-logical-operators/article.md +++ b/1-js/02-first-steps/11-logical-operators/article.md @@ -133,7 +133,7 @@ Das führt im Vergleich zu einem "reinen, klassischen, nur-Booleschen ODER" zu e alert(x); // undefined, denn (x = 1) wird nicht ausgewertet ``` - It hingegen das erste Argument `false`, wertet `||` das zweite aus und führt die Zuweisung durch: + Ist hingegen das erste Argument `false`, wertet `||` das Zweite aus und führt die Zuweisung durch: ```js run no-beautify let x; From 4f9a965cc4556c1be7e6edf9b6205636c20034cb Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Sun, 5 Apr 2020 17:17:12 +0200 Subject: [PATCH 37/41] Review issues / update #6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Christian Hegedüs --- 1-js/02-first-steps/11-logical-operators/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/02-first-steps/11-logical-operators/article.md b/1-js/02-first-steps/11-logical-operators/article.md index 1a7680dde..8ab45c0ca 100644 --- a/1-js/02-first-steps/11-logical-operators/article.md +++ b/1-js/02-first-steps/11-logical-operators/article.md @@ -194,7 +194,7 @@ Für mehrere mit UND verknüpfte Werte: result = value1 && value2 && value3; ``` -arbeitet der Operator UND `&&` wie folgt: +Der Operator UND `&&` arbeitet wie folgt: - Wertet Operanden von links nach rechts aus. - Konvertiert jeden Operand in einen Booleschen Wert. Ist das Ergebnis `false`, endet seine Auswertung und er gibt den ursprünglichen Wert dieses Operanden zurück. From 33f1edb369887eab359515c1d339958fdadbbae7 Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Sun, 5 Apr 2020 17:17:24 +0200 Subject: [PATCH 38/41] Review issues / update #7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Christian Hegedüs --- 1-js/02-first-steps/11-logical-operators/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/02-first-steps/11-logical-operators/article.md b/1-js/02-first-steps/11-logical-operators/article.md index 8ab45c0ca..1135c7603 100644 --- a/1-js/02-first-steps/11-logical-operators/article.md +++ b/1-js/02-first-steps/11-logical-operators/article.md @@ -258,7 +258,7 @@ if (x > 0) { } ``` -Die Variante mit `&&` wirkt knapper. Aber `if` ist leichter zu identifizieren und tendenziell eines kleines bißchen verständlicher. +Die Variante mit `&&` wirkt knapper. Aber `if` ist leichter zu identifizieren und tendenziell eines kleines bisschen verständlicher. Daher empfehlen wir, jedes Konstrukt gemäß seinem Zweck einzusetzen: `if` nutzen, wenn wir eine Fallunterscheidung haben wollen, `&&` für die logische Operation UND. From ec4644f61923cb7a897a2bd61341c7af83382eb5 Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 21 Apr 2020 12:48:35 +0200 Subject: [PATCH 39/41] Review round #2 200420 / update #1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Christian Hegedüs --- .../11-logical-operators/7-check-if-out-range/task.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/02-first-steps/11-logical-operators/7-check-if-out-range/task.md b/1-js/02-first-steps/11-logical-operators/7-check-if-out-range/task.md index 2036a0efc..5e4c1bf88 100644 --- a/1-js/02-first-steps/11-logical-operators/7-check-if-out-range/task.md +++ b/1-js/02-first-steps/11-logical-operators/7-check-if-out-range/task.md @@ -4,6 +4,6 @@ importance: 3 # Bereichsprüfung (negativ) -Schreibe die Bedingung für eine Fallunterscheidung mit `if` um zu prüfen, daß `age` NICHT zwischen `14` und `90` liegt (Grenzen inklusive). +Schreibe die Bedingung für eine Fallunterscheidung mit `if` um zu prüfen, dass `age` NICHT zwischen `14` und `90` liegt (Grenzen inklusive). Formuliere 2 Varianten, die erste mit NICHT `!`, die zweite -- ohne. From e8f1d7d9483775aa1dde1e41602d651b117c36ae Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 21 Apr 2020 12:49:13 +0200 Subject: [PATCH 40/41] Review round #2 200420 / update #2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Christian Hegedüs --- .../11-logical-operators/7-check-if-out-range/task.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/02-first-steps/11-logical-operators/7-check-if-out-range/task.md b/1-js/02-first-steps/11-logical-operators/7-check-if-out-range/task.md index 5e4c1bf88..64f3e82ca 100644 --- a/1-js/02-first-steps/11-logical-operators/7-check-if-out-range/task.md +++ b/1-js/02-first-steps/11-logical-operators/7-check-if-out-range/task.md @@ -6,4 +6,4 @@ importance: 3 Schreibe die Bedingung für eine Fallunterscheidung mit `if` um zu prüfen, dass `age` NICHT zwischen `14` und `90` liegt (Grenzen inklusive). -Formuliere 2 Varianten, die erste mit NICHT `!`, die zweite -- ohne. +Formuliere 2 Varianten, die Erste mit NICHT `!`, die Zweite -- ohne. From 360200d2c38f1183d418263b8d3f17e66bd97ca5 Mon Sep 17 00:00:00 2001 From: SirCodewright Date: Tue, 21 Apr 2020 12:49:41 +0200 Subject: [PATCH 41/41] Review round #2 200420 / update #3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Christian Hegedüs --- .../11-logical-operators/8-if-question/solution.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/02-first-steps/11-logical-operators/8-if-question/solution.md b/1-js/02-first-steps/11-logical-operators/8-if-question/solution.md index 35faef742..e5f9ba763 100644 --- a/1-js/02-first-steps/11-logical-operators/8-if-question/solution.md +++ b/1-js/02-first-steps/11-logical-operators/8-if-question/solution.md @@ -4,7 +4,7 @@ Details: ```js run // Ausgeführt. -// The result of -1 || 0 = -1, effektiv wahr +// Das Resultat von -1 || 0 = -1, effektiv wahr if (-1 || 0) alert( 'Erster' ); // Nicht ausgeführt