Created
August 29, 2017 00:43
-
-
Save claudiainbytes/b5d035b4451fb0d8cb8e77ee4f709627 to your computer and use it in GitHub Desktop.
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 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