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

11 lines
239 B
JavaScript
Raw Normal View History

const palindromes = function (string) {
const reversed = string.split("").reverse().join("");
if (reversed === string) {
return true;
}
return false;
2024-01-11 08:52:05 +00:00
};
// Do not edit below this line
module.exports = palindromes;