UNPKG

is_pelindrome

Version:

Check whether a string or number is a palindrome.

27 lines (17 loc) 1.03 kB
# is_palindrome > Returns `true` if the given string or number is a palindrome. Ignores spaces, punctuation, and case. [![NPM version](https://img.shields.io/npm/v/is-palindrome.svg)](https://www.npmjs.com/package/is-palindrome) [![Monthly downloads](https://img.shields.io/npm/dm/is-palindrome.svg)](https://www.npmjs.com/package/is-palindrome) [![Total downloads](https://img.shields.io/npm/dt/is-palindrome.svg)](https://www.npmjs.com/package/is-palindrome) [![Linux Build Status](https://img.shields.io/badge/build-passing-brightgreen.svg)](#) --- ## ✅ Installation Install with npm: ```bash npm install --save is-palindrome const isPalindrome = require('is_palindrome'); console.log(isPalindrome('madam')); // true console.log(isPalindrome(121)); // true console.log(isPalindrome('hello')); // false console.log(isPalindrome('Was it a car or a cat I saw?')); // true console.log(isPalindrome('No lemon, no melon')); // true