Skip to content

Instantly share code, notes, and snippets.

@vstarck
Created August 29, 2011 15:20
Show Gist options
  • Save vstarck/1178599 to your computer and use it in GitHub Desktop.
Save vstarck/1178599 to your computer and use it in GitHub Desktop.
String stuff
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