odin-js-fundamentals-part-5/09_palindromes/palindromes.js

11 lines
239 B
JavaScript

const palindromes = function (string) {
const reversed = string.split("").reverse().join("");
if (reversed === string) {
return true;
}
return false;
};
// Do not edit below this line
module.exports = palindromes;