Created
May 10, 2012 23:44
-
-
Save patrickdevivo/2656612 to your computer and use it in GitHub Desktop.
CoffeeScript palindrome...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
palindrome = (string) -> if string.toUppercase() == string.toUppercase().split('').reverse().join('') then return true else return false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var palindrome = function(string) {if(string.toUppercase() == string.toUppercase().split('').reverse().join('')) {return true} else {return false }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nicely done. Minor change - just need to use string.toUpperCase()
The "C" was not capitalized