Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 defer src="js/functions.js"></script>
<title>Кекстаграм</title>
</head>

Expand Down
20 changes: 20 additions & 0 deletions js/functions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
function checkLengthString(string = '', number = 1) {

Check failure on line 1 in js/functions.js

View workflow job for this annotation

GitHub Actions / Check

'checkLengthString' is defined but never used
return string.length <= number;
}

function isPalindrome(string = '') {

Check failure on line 5 in js/functions.js

View workflow job for this annotation

GitHub Actions / Check

'isPalindrome' is defined but never used
const normalizeString = string.replaceAll(' ', '').toLowerCase();
const reverseString = normalizeString.split('').reverse().join('');
return normalizeString === reverseString;
}

function getNumbers(string = '') {

Check failure on line 11 in js/functions.js

View workflow job for this annotation

GitHub Actions / Check

'getNumbers' is defined but never used
const str = String(string);
let result = '';
for(const sign of str) {
if(sign >= '0' && sign <= '9') {
result += sign;
}
}
return parseInt(result, 10);
}
Loading