Passed first test in exercise 09
Converting string to array, reversing array, reconverting array to string
This commit is contained in:
parent
afbd11dad1
commit
27551435b6
|
@ -1,5 +1,9 @@
|
|||
const palindromes = function () {
|
||||
|
||||
const palindromes = function (string) {
|
||||
const reversed = string.split("").reverse().join("");
|
||||
if (reversed === string) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
// Do not edit below this line
|
||||
|
|
Loading…
Reference in New Issue