Created
August 29, 2011 15:20
-
-
Save vstarck/1178599 to your computer and use it in GitHub Desktop.
String stuff
This file contains 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
function sacarCharRepetidos(s) { | |
return s.split('').reduce(function(memo, chr) { | |
return memo += memo.indexOf(chr) == -1 ? chr : ''; | |
}, ''); | |
} | |
function letrasFaltantes(s) { | |
return s.split('').reduce(function(memo, chr) { | |
return memo.replace(chr, ''); | |
}, 'abcdefghijklmnopqrstuvwxyz') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment