Tell us what’s happening:
I’m having trouble making sense of the criteria for converting to spinal case. From the instructions I assumed all that would be needed was to replace spaces with hyphens, but see that there are many criteria needed for the tests. While I could for example replace all capital letters (after the 1st) and special characters to pass the specific tests, I would be coding to the few tests, and then ignoring the instructions.
Specifically, JavaScript should simply be made lower case but thisIsSpinalTap needs to be hyphenated at before each capital letter in order to pass the tests.
I’m not aware of a means to use RegExp to detect words in the dictionary for example to help pass the tests, so am curious if there’s some advice that can be given to build out the conceptual logic that can then be made into code.
Your code so far
const spinalCase = sentence => {
return sentence.replace(/\s+/g,'-').toLowerCase();
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36
Challenge Information:
Implement a Spinal Case Converter - Implement a Spinal Case Converter
