Skip to content

Instantly share code, notes, and snippets.

@jonathanweiss
Last active March 7, 2017 10:29
Show Gist options
  • Save jonathanweiss/84dd5e9c8d80a7784f8540d6735574dc to your computer and use it in GitHub Desktop.
Save jonathanweiss/84dd5e9c8d80a7784f8540d6735574dc to your computer and use it in GitHub Desktop.
Another functional programming example for Raphael
'asdf klkl wererw cvxcxv'
.split(' ')
.reduce(function(list, word){
if (list.length < 2) {
list.push(word);
}
return list;
}, [])
.map(function(word) {
return word
.substring(0, 1)
.toUpperCase()
})
.join('');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment