Last active
June 28, 2020 09:16
-
-
Save Charpell/8dd2ef484c551ab919bd0bbc92a25161 to your computer and use it in GitHub Desktop.
Exercise 1
This file contains 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
function firstLetter(name) { | |
if (typeof(name) !== "string" || name.length < 3) return "Incorrect Input" | |
const removedLetter = name.slice(0, -1) | |
const result = name[0].toUpperCase() + removedLetter.slice(1) | |
return result | |
} | |
console.log('firstLetter', firstLetter('Obito')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you Sir.