Tell us what’s happening:
This is how I solved this problem but it’s completely different than the solutions. Anything wrong with how I complete the algorithm?
Your code so far
function spinalCase(str) {
let spinalCaseRegex = /\w[a-z]+/g
let result = str.match(spinalCaseRegex)
return result.join("-").toLowerCase();
}
spinalCase('This Is Spinal Tap');
spinalCase("thisIsSpinalTap")
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36
Challenge: Intermediate Algorithm Scripting - Spinal Tap Case
haha tysm! I’m solving a lot of these questions in a different way than the solution. Would you recommend that I try to do it the solution way instead? The solution always seems to be completely different from how I solve it so I’m not sure if what I’m doing is wrong or right.
It is good that you are comparing and contrasting. But do your own thing, that’s your super-power. (So long as you are meeting the objectives that are laid out)