allalgorithms-js

Palindrome

A palindrome is a word which reads the same backward as forward, such as ‘madam’ or ‘racecar’

Install

npm install allalgorithms

Usage

const allalgorithms = require('allalgorithms');

const str = 'racecar';

console.log(allalgorithms.strings.palindrome(str));
// -> true

API

palindrome(str)

Returns true if string is palindrome

Params: