Skip to content

Commit

Permalink
Merge pull request #2 from Aleksandr-Anokhin/module2-task1
Browse files Browse the repository at this point in the history
  • Loading branch information
keksobot authored Sep 19, 2024
2 parents 208204a + c987b9f commit 3fdb113
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/style.css">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<script src="/js/functions.js"></script>
<title>Кекстаграм</title>
</head>

Expand Down
35 changes: 35 additions & 0 deletions js/functions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Строка короче 20 символов
const stringFirst = 'Двадцать';
if (stringFirst.length < 20) {
console.log ('true');

Check failure on line 4 in js/functions.js

View workflow job for this annotation

GitHub Actions / Check

Unexpected console statement
}

Check failure on line 5 in js/functions.js

View workflow job for this annotation

GitHub Actions / Check

Closing curly brace does not appear on the same line as the subsequent block
else {
console.log ('false');

Check failure on line 7 in js/functions.js

View workflow job for this annotation

GitHub Actions / Check

Unexpected console statement
}

// Длина строки не более 6 символов
const stringSecond = 'Вторая';
if (stringSecond.length <= 6) {
console.log ('true');

Check failure on line 13 in js/functions.js

View workflow job for this annotation

GitHub Actions / Check

Unexpected console statement
}

Check failure on line 14 in js/functions.js

View workflow job for this annotation

GitHub Actions / Check

Closing curly brace does not appear on the same line as the subsequent block
else {
console.log ('false');

Check failure on line 16 in js/functions.js

View workflow job for this annotation

GitHub Actions / Check

Unexpected console statement
}

// Строка длиннее 10 символов
const stringThird = 'Третья';
if (stringThird.length > 10) {
console.log ('true');

Check failure on line 22 in js/functions.js

View workflow job for this annotation

GitHub Actions / Check

Unexpected console statement
}

Check failure on line 23 in js/functions.js

View workflow job for this annotation

GitHub Actions / Check

Closing curly brace does not appear on the same line as the subsequent block
else {
console.log ('false');

Check failure on line 25 in js/functions.js

View workflow job for this annotation

GitHub Actions / Check

Unexpected console statement
}

// Функция для проверки, является ли строка палиндромом.
const palindrome = str => {

Check failure on line 29 in js/functions.js

View workflow job for this annotation

GitHub Actions / Check

Expected parentheses around arrow function argument
str = str.toLowerCase();
return str === str.split('').reverce().join('');
}
const str = 'level';
const isPalindrome = palindrome(str);
console.log (isPalindrome);

0 comments on commit 3fdb113

Please sign in to comment.