I wonder how to write palindrome in javascript, where I input different words and program shows if word is palindrome or not. For example word noon is palindrome, while bad
Try this
isPalindrome = (string) => { if (string === string.split('').reverse().join('')) { console.log('is palindrome'); } else { console.log('is not palindrome'); } } isPalindrome(string)