Skip to content

Instantly share code, notes, and snippets.

@claudiainbytes
Created August 29, 2017 00:43
Show Gist options
  • Select an option

  • Save claudiainbytes/b5d035b4451fb0d8cb8e77ee4f709627 to your computer and use it in GitHub Desktop.

Select an option

Save claudiainbytes/b5d035b4451fb0d8cb8e77ee4f709627 to your computer and use it in GitHub Desktop.
var name = "AlbERt EINstEiN";
function nameChanger(oldName) {
var finalName = oldName;
// Your code goes here!
finalName = finalName.toLowerCase();
finalName = finalName.split(" ");
finalName = finalName[0].charAt(0).toUpperCase() + finalName[0].slice(1) + " " + finalName[1].toUpperCase();
// Don't delete this line!
return finalName;
};
// Did your code work? The line below will tell you!
console.log(nameChanger(name));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment