Determine if string is a palindrome using recursion - Javascript

preview_player
Показать описание
Write a recursive function called isPalindrome which returns
true if the string passed to it is a palindrome (reads the same forward and backward).
Otherwise returns false.
isPalindrome(‘awesome’) // false
isPalindrome(‘foobar’) // false
isPalindrome(‘tacocat’) // true
isPalindrome(‘amanaplanacanalpanama’) // true
isPalindrome(‘amanaplanacanalpandemonium’) // false
Рекомендации по теме
Комментарии
Автор

thanks so much for the detailed explanation of recursion for checking palindromes and reversing strings. helped me tons😁

edwigefomum
Автор

• 🙏🙏Very nice and useful . 😍😍 thanks for 👍👍uploading the video

computerlearningbyargusaca
Автор

instead of doing str.slice(-1) in the 3rd if statement, can you put str.length - 1 instead?

DamienHebert-zd
visit shbcf.ru