From e9ad1caa001fef1a0679fa436870178911b75704 Mon Sep 17 00:00:00 2001 From: acp-anjan <33113902+acp-anjan@users.noreply.github.com> Date: Wed, 16 Oct 2019 14:36:48 +0545 Subject: [PATCH] palindrome program --- src/algorithms/uncategorized/palindrome.js | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 src/algorithms/uncategorized/palindrome.js diff --git a/src/algorithms/uncategorized/palindrome.js b/src/algorithms/uncategorized/palindrome.js new file mode 100644 index 00000000..a43cf2cf --- /dev/null +++ b/src/algorithms/uncategorized/palindrome.js @@ -0,0 +1,5 @@ +function palindrome(text) { +var reversedText = text.toLowerCase() + .split('').reverse().join(''); +return text === reversedText; +}