Skip to content

Instantly share code, notes, and snippets.

@johnstew
Created February 14, 2013 20:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save johnstew/4956289 to your computer and use it in GitHub Desktop.
Save johnstew/4956289 to your computer and use it in GitHub Desktop.
Coderbyte challenge.
function LetterCapitalize(str) {
var temp = str.split(" ");
function Capitalize(value){
var result = value.charAt(0).toUpperCase();
var substring = value.substring(1, value.length);
var final = result+substring;
return final;
}
var final = temp.map(Capitalize).join(" ");
return final;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment