You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
return text === text.split("").reverse().join("");
}
if (inputText) {
if (isPalindrome(inputText)) {
console.log(`\x1b[36m"${inputText}" \x1b[32m is a palindrome\x1b[0m`);
process.exit(0);
} else {
console.log(`\x1b[33m"${inputText}" \x1b[31m is NOT a palindrome\x1b[0m`);
process.exit(1);
}
} else {
console.log("\x1b[33mNo words to verify, please type any word and try again. \n \x1b[90m`node isPalindrome WORDHERE` or \n `node isPalindrome 'PHRASE HERE'\x1b[0m");