mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-11-10 11:09:43 +08:00
palindrome program
This commit is contained in:
parent
dc1047df72
commit
e9ad1caa00
5
src/algorithms/uncategorized/palindrome.js
Normal file
5
src/algorithms/uncategorized/palindrome.js
Normal file
@ -0,0 +1,5 @@
|
||||
function palindrome(text) {
|
||||
var reversedText = text.toLowerCase()
|
||||
.split('').reverse().join('');
|
||||
return text === reversedText;
|
||||
}
|
Loading…
Reference in New Issue
Block a user