Skip to content

Instantly share code, notes, and snippets.

@ar2zee
Created April 10, 2017 20:56
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
easy method with strings
var Genius = 'AlBErt EinsTeIn'
function changingName(oldName){
var FixedName = oldName;
var names = oldName.split(' ');
names[1] = names[1].toUpperCase();
names[0] = names[0].slice(0,1).toUpperCase() + names[0].slice(1).toLowerCase();
FixedName = names.join(' ');
return FixedName;
}
console.log(changingName(Genius));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment