Skip to content

Instantly share code, notes, and snippets.

@jkup
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkup/db670a461c42c73d5032 to your computer and use it in GitHub Desktop.
Save jkup/db670a461c42c73d5032 to your computer and use it in GitHub Desktop.
def capitalizeAll(args: String*) = {
args.map (_.capitalize)
}
capitalizeAll("hello", "goodbye", "farewell")
// --vs--
function capitalizeAll(Array $words) {
return array_map(function($word) {
return ucfirst($word);
}, $words);
}
capitalizeAll(array('hello', 'goodbye', 'farewell'));
@DrBoolean
Copy link

def capitalizeAll(args: String*) = {
  args.map (_.capitalize)
}

@jkup
Copy link
Author

jkup commented Jan 16, 2015

dang, that's way nicer! I'm still new at this haha :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment