function toCamelCase(str){
let splittingWord = str.split(/-|_/);
let camelCaseString = "";
for(let i = 0; i < splittingWord.length; i++){
const upperLetters = splittingWord[i].toUpperCase()[0];
const lowerLetters = splittingWord[i].slice(1).toLowerCase();
if (i === 0) {
camelCaseString += upperLetters + lowerLetters;
} else {
camelCaseString += splittingWord[i].toUpperCase()[0]+lowerLetters;
}
}
console.log(camelCaseString);
}
toCamelCase("the-stealth-warrior");
function toCamelCase(str){
let splittingWord = str.split(/-|_/);
let camelCaseString = "";
for(let i = 0; i < splittingWord.length; i++){
const upperLetters = splittingWord[i].toUpperCase()[0];
const lowerLetters = splittingWord[i].slice(1).toLowerCase();
if (i === 0) {
camelCaseString += upperLetters + lowerLetters;
} else {
camelCaseString += splittingWord[i].toUpperCase()[0]+lowerLetters;
}
}
console.log(camelCaseString);
}
toCamelCase("the-stealth-warrior");