In the line you need to find all the hyphens or underscores, remove them and make the letter after them big:
function toCamelCase(string) { return string.replace(/-|_/gi, (str, index, s) => { return s[index + 1].toUpperCase(); }); } console.log(toCamelCase("the-stealth-warrior"));