Skip to content

Commit 17f3e72

Browse files
authored
Merge pull request #693 from hexlet-basics/revert-690-update-logical-negation
Revert "update description"
2 parents a246a72 + 0fcd7ce commit 17f3e72

File tree

2 files changed

+0
-43
lines changed

2 files changed

+0
-43
lines changed

modules/45-logic/28-logical-negation/description.en.yml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,6 @@ theory: |
1616
1717
I.e., we can just put a `!` to the left of the function call and get the opposite result.
1818
19-
Negation works for any expression. Any value will be cast to the opposite boolean value.
20-
21-
```javascript
22-
const message = 'Hello, world!';
23-
// Works with constants and variables
24-
!message; // false
25-
26-
// And directly with the values
27-
!5; // false
28-
!'hello'; // false
29-
!0; // true
30-
```
31-
3219
Negation is a powerful tool that allows you to concisely express the desired rules in your code without having to write new functions.
3320
3421
What if you wrote `!!isEven(10)` like this? Suddenly, the code would work. Double negation in logic is equivalent to no negation at all.
@@ -39,14 +26,6 @@ theory: |
3926
!!isEven(10); // true
4027
```
4128
42-
Negatives can be inside other expressions.
43-
44-
```javascript
45-
true && !false; // true
46-
!false || false; // true
47-
!!isEven(10) && !'hello'; // false
48-
!!isEven(10) && !!'hello'; // true
49-
5029
instructions: |
5130
5231
1. Write a function, `isPalindrome()`, to check if a word is a palindrome. A palindrome is a word that reads the same backwards as it does forwards.

modules/45-logic/28-logical-negation/description.ru.yml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,6 @@ theory: |
1616
1717
То есть мы просто добавили `!` слева от вызова функции и получили обратное действие.
1818
19-
Отрицание работает для любых выражений. Любое значение будет приведено к противоположному значению логического типа.
20-
21-
```javascript
22-
const message = 'Hello, world!';
23-
// Работает с константами и переменными
24-
!message; // false
25-
26-
// И напрямую со значениями
27-
!5; // false
28-
!'hello'; // false
29-
!0; // true
30-
```
31-
3219
Отрицание — мощный инструмент, который позволяет лаконично выражать задуманные правила в коде без необходимости писать новые функции.
3320
3421
А что если написать так `!!isEven(10)`? Внезапно, но код сработает. В логике двойное отрицание подобно отсутствию отрицания вообще.
@@ -39,15 +26,6 @@ theory: |
3926
!!isEven(10); // true
4027
```
4128
42-
Отрицания могут быть внутри других выражений.
43-
44-
```javascript
45-
true && !false; // true
46-
!false || false; // true
47-
!!isEven(10) && !'hello'; // false
48-
!!isEven(10) && !!'hello'; // true
49-
```
50-
5129
instructions: |
5230
5331
В этом уроке вам нужно будет реализовать две функции `isPalindrome()` и `isNotPalindrome()`

0 commit comments

Comments
 (0)