Created
April 10, 2017 20:56
-
-
Save ar2zee/85767466f9b1bf1f864387757c126bcd to your computer and use it in GitHub Desktop.
easy method with strings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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