MCQs>IT & Programming>JavaScript>The following one line function will return true if str is a palindrome; otherwise, it returns false. function isPalindrome(str) { str = str.replace(/\W/g, '').toLowerCase(); return (str == str.split('').reverse().join('')); }
JavaScript MCQs
The following one line function will return true if str is a palindrome; otherwise, it returns false. function isPalindrome(str) { str = str.replace(/\W/g, '').toLowerCase(); return (str == str.split('').reverse().join('')); }
Answer
Correct Answer: true
Explanation:
Note: This Question is unanswered, help us to find answer for this one