A palindrome is a word which reads the same backward as forward, such as ‘madam’ or ‘racecar’
npm install allalgorithms
const allalgorithms = require('allalgorithms');
const str = 'racecar';
console.log(allalgorithms.strings.palindrome(str));
// -> true
Returns true if string is palindrome
str
: String