Skip to content

Commit

Permalink
fixes the name and improved it
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniil888-m committed Nov 22, 2024
1 parent daf06a9 commit 87ef10d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions js/functions.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
function checkStr(string, length) {
return string.length <= length;
}

checkStr('fff', 3);

function isPalimdrome(string) {
string = string.replaceAll(' ', '');
function isPalindrome(string) {
string = string.toLowerCase().replaceAll(' ', '');
const reversedString = string.split('').reverse().join('');
return string === reversedString;
}
isPalimdrome('ooppoo ooppoo');
isPalindrome('ooppoo ooppoo');
function getNums(string) {
string = String(string);
let result = '';
Expand Down

0 comments on commit 87ef10d

Please sign in to comment.